]> git.sesse.net Git - vlc/commitdiff
update: Make sure we don't leak.
authorPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 1 Sep 2008 23:31:02 +0000 (01:31 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Mon, 1 Sep 2008 23:34:22 +0000 (01:34 +0200)
This fix also a crash because of a non joined thread on Mac OS X.

modules/gui/macosx/intf.m
modules/gui/macosx/update.h
modules/gui/macosx/update.m
src/misc/update.c

index 015cd16683d3165c48b6734543572d3c8665ecbb..9782a192adc3ad1f16d38639bd038b69cd813445 100644 (file)
@@ -672,6 +672,8 @@ static VLCMain *_o_sharedMainInstance = nil;
     /* remove global observer watching for vout device changes correctly */
     [[NSNotificationCenter defaultCenter] removeObserver: self];
 
+    [o_update end];
+
     /* release some other objects here, because it isn't sure whether dealloc
      * will be called later on */
 
index 93500fc6ca13a75b25f90e87a3c603b1539a28f5..0db8b0df2e4b72c67d97a9e7f4aff9e0d87e11bf 100644 (file)
@@ -47,6 +47,8 @@
     bool b_checked;
 }
 
+- (void)end;
+
 - (IBAction)download:(id)sender;
 - (IBAction)okay:(id)sender;
 - (IBAction)changeCheckUpdateOnStartup:(id)sender;
index 88ed6bd755596489bb4b6e9fc87f0e59d2bb239d..f8c71ae66c60f8d37eeb52a6a39445ece361fc36 100644 (file)
@@ -69,6 +69,11 @@ static VLCUpdate *_o_sharedInstance = nil;
     return _o_sharedInstance;
 }
 
+- (void)end
+{
+    if( p_u ) update_Delete( p_u );
+}
+
 - (void)awakeFromNib
 {
     /* we don't use - (BOOL)shouldCheckUpdateOnStartup because we don't want
index d3ca5d20b5f5de9854d065444d780f9c32e3d74e..7e7913a0b24d2c328a464b07f1be13fdb68e3216 100644 (file)
@@ -1074,6 +1074,7 @@ void update_Delete( update_t *p_update )
         assert( !p_update->p_download );
         vlc_object_kill( p_update->p_check );
         vlc_thread_join( p_update->p_check );
+        vlc_object_release( p_update->p_check );
     }
     else if( p_update->p_download )
     {