Commit 720f8276 authored by Rafaël Carré's avatar Rafaël Carré

Unref D-Bus connections when not using them anymore

parent 05c276b0
...@@ -459,6 +459,8 @@ static void Close ( vlc_object_t *p_this ) ...@@ -459,6 +459,8 @@ static void Close ( vlc_object_t *p_this )
PL_UNLOCK; PL_UNLOCK;
pl_Release( p_playlist ); pl_Release( p_playlist );
dbus_connection_unref( p_intf->p_sys->p_conn );
free( p_intf->p_sys ); free( p_intf->p_sys );
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
*****************************************************************************/ *****************************************************************************/
struct probe_sys_t struct probe_sys_t
{ {
DBusConnection *p_connection;
LibHalContext *p_ctx; LibHalContext *p_ctx;
int i_devices; int i_devices;
device_t **pp_devices; device_t **pp_devices;
...@@ -88,10 +89,12 @@ static int Open( vlc_object_t *p_this ) ...@@ -88,10 +89,12 @@ static int Open( vlc_object_t *p_this )
free( p_probe->p_sys ); free( p_probe->p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
p_sys->p_connection = p_connection;
libhal_ctx_set_dbus_connection( p_probe->p_sys->p_ctx, p_connection ); libhal_ctx_set_dbus_connection( p_probe->p_sys->p_ctx, p_connection );
if( !libhal_ctx_init( p_probe->p_sys->p_ctx, &dbus_error ) ) if( !libhal_ctx_init( p_probe->p_sys->p_ctx, &dbus_error ) )
{ {
msg_Err( p_probe, "hal not available : %s", dbus_error.message ); msg_Err( p_probe, "hal not available : %s", dbus_error.message );
dbus_connection_unref( p_connection );
dbus_error_free( &dbus_error ); dbus_error_free( &dbus_error );
free( p_sys ); free( p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -106,6 +109,7 @@ static void Close( vlc_object_t *p_this ) ...@@ -106,6 +109,7 @@ static void Close( vlc_object_t *p_this )
{ {
device_probe_t *p_probe = (device_probe_t *) p_this; device_probe_t *p_probe = (device_probe_t *) p_this;
probe_sys_t *p_sys = p_probe->p_sys; probe_sys_t *p_sys = p_probe->p_sys;
dbus_connection_unref( p_sys->p_connection );
free( p_sys ); free( p_sys );
} }
......
...@@ -196,6 +196,8 @@ static void Close( vlc_object_t *p_this ) ...@@ -196,6 +196,8 @@ static void Close( vlc_object_t *p_this )
} }
free( p_sys ); free( p_sys );
#ifdef HAVE_HAL_1 #ifdef HAVE_HAL_1
dbus_connection_unref( p_sys->p_connection );
struct udi_input_id_t *p_udi_entry; struct udi_input_id_t *p_udi_entry;
while( p_sys->i_devices_number > 0 ) while( p_sys->i_devices_number > 0 )
......
...@@ -1840,6 +1840,7 @@ static void InitDeviceValues( libvlc_int_t *p_vlc ) ...@@ -1840,6 +1840,7 @@ static void InitDeviceValues( libvlc_int_t *p_vlc )
#ifdef HAVE_HAL_1 #ifdef HAVE_HAL_1
libhal_ctx_shutdown( ctx, NULL ); libhal_ctx_shutdown( ctx, NULL );
dbus_connection_unref( p_connection );
#else #else
hal_shutdown( ctx ); hal_shutdown( ctx );
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment