]> git.sesse.net Git - vlc/commitdiff
MacOSX/Framework/VLCLibrary.m: Clear potential memory leak & formatting clean up.
authorFaustino Osuna <riquedafreak@videolan.org>
Thu, 3 Jan 2008 20:54:02 +0000 (20:54 +0000)
committerFaustino Osuna <riquedafreak@videolan.org>
Thu, 3 Jan 2008 20:54:02 +0000 (20:54 +0000)
extras/MacOSX/Framework/Sources/VLCLibrary.m
extras/MacOSX/Framework/Sources/VLCMediaList.m
extras/MacOSX/Framework/Sources/VLCVideoView.m

index 91d22286ae1604491c594515b509e4df38d58350..f3a42c551c6c227d88850f03d73db3397482f510 100644 (file)
@@ -33,7 +33,7 @@ static VLCLibrary * sharedLibrary = nil;
 void __catch_exception( void * e, const char * function, const char * file, int line_number )
 {
     libvlc_exception_t * ex = (libvlc_exception_t *)e;
-    if (libvlc_exception_raised( ex ))
+    if( libvlc_exception_raised( ex ) )
     {
         NSException* libvlcException = [NSException
             exceptionWithName:@"LibVLCException"
@@ -92,13 +92,18 @@ static void * DestroySharedLibraryAtExit( void )
 
 - (void)dealloc 
 {
-    if (instance
+    if( instance 
     {
         libvlc_exception_t ex;
         libvlc_exception_init( &ex );
         
         libvlc_release( instance, &ex );
+        libvlc_exception_clear( &ex );
     }
+    
+    if( self == sharedLibrary ) 
+        sharedLibrary = nil;
+    
     instance = nil;
     [audio release];
     [super dealloc];
index e813142ce90181f61f7550bc0fa981c2cf9d5977..a6d0378abe49d10ce7e6401dcfee01e4f0456c37 100644 (file)
@@ -299,6 +299,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
     int start = [[[arrayOfArgs objectAtIndex: 0] objectForKey:@"index"] intValue];
     int end = [[[arrayOfArgs objectAtIndex: [arrayOfArgs count]-1] objectForKey:@"index"] intValue];
     NSRange range = NSMakeRange(start, end-start);
+
     [self willChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndexesInRange:range] forKey:@"media"];
     for( NSDictionary * args in arrayOfArgs )
     {
index a0e96d95b1e7a9b64aeddd0ea05888e11dcd4fa3..34b6f7a7a01d3fd2afbcd540ec449b0a132e7b9d 100644 (file)
@@ -65,8 +65,6 @@ NSString * VLCVideoViewLeftFullScreen       = @"VLCVideoViewLeftFullScreen";
 - (void)addVoutLayer:(CALayer *)aLayer;
 @end
 
-
-
 /******************************************************************************
  * Interface & Implementation VLCConstraintLayoutManager
  *