Commit 5beb4d96 authored by Faustino Osuna's avatar Faustino Osuna

MacOSX/Framework/VLCLibrary.m: Clear potential memory leak & formatting clean up.

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