]> git.sesse.net Git - vlc/commitdiff
Unref D-Bus connections when not using them anymore
authorRafaël Carré <funman@videolan.org>
Tue, 21 Nov 2006 16:34:02 +0000 (16:34 +0000)
committerRafaël Carré <funman@videolan.org>
Tue, 21 Nov 2006 16:34:02 +0000 (16:34 +0000)
modules/control/dbus.c
modules/misc/probe/hal.c
modules/services_discovery/hal.c
src/libvlc-common.c

index dad21f5c6abfc5be7061ccbc27e6b287a4754700..62de186c2ef87c6b864d12db03329aa29b350441 100644 (file)
@@ -459,6 +459,8 @@ static void Close   ( vlc_object_t *p_this )
     PL_UNLOCK;
     pl_Release( p_playlist );
 
+    dbus_connection_unref( p_intf->p_sys->p_conn );
+
     free( p_intf->p_sys );
 }
 
index d16926d095362739bb5d1f1d6402229f09060e36..c5bd7384b49492a0366e2f7e6e16ad92047e7f40 100644 (file)
@@ -32,6 +32,7 @@
  *****************************************************************************/
 struct probe_sys_t
 {
+    DBusConnection *p_connection;
     LibHalContext *p_ctx;
     int            i_devices;
     device_t     **pp_devices;
@@ -88,10 +89,12 @@ static int Open( vlc_object_t *p_this )
         free( p_probe->p_sys );
         return VLC_EGENERIC;
     }
+    p_sys->p_connection = 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 ) )
     {
         msg_Err( p_probe, "hal not available : %s", dbus_error.message );
+        dbus_connection_unref( p_connection );
         dbus_error_free( &dbus_error );
         free( p_sys );
         return VLC_EGENERIC;
@@ -106,6 +109,7 @@ static void Close( vlc_object_t *p_this )
 {
     device_probe_t *p_probe = (device_probe_t *) p_this;
     probe_sys_t *p_sys = p_probe->p_sys;
+    dbus_connection_unref( p_sys->p_connection );
     free( p_sys );
 }
 
index 7d0166f9d9e0c70d9dd856d535ab89ba2b1399df..08cce13f0f3950b7d403d4e5e6fbf34fe163e4ad 100644 (file)
@@ -196,6 +196,8 @@ static void Close( vlc_object_t *p_this )
     }
     free( p_sys );
 #ifdef HAVE_HAL_1
+    dbus_connection_unref( p_sys->p_connection );
+
     struct udi_input_id_t *p_udi_entry;
 
     while( p_sys->i_devices_number > 0 )
index aeed9152be10cb9cd017753d802e5356e65aa934..e9a9a42d93137b5d0e3fe37c328c3d4a1e0e3b77 100644 (file)
@@ -1840,6 +1840,7 @@ static void InitDeviceValues( libvlc_int_t *p_vlc )
 
 #ifdef HAVE_HAL_1
         libhal_ctx_shutdown( ctx, NULL );
+        dbus_connection_unref( p_connection );
 #else
         hal_shutdown( ctx );
 #endif