Commit b1f013e7 authored by Toralf Niebuhr's avatar Toralf Niebuhr Committed by Rémi Duraffort

use NSAutoreleasePool::drain instead of NSAutoreleasePool::release since...

use NSAutoreleasePool::drain instead of NSAutoreleasePool::release since VLCKit ist compiled with Objective-C Garbage Collection = Supported
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit b7508014f4b124bd1a98f32fbe59ef803198e7b9)
Signed-off-by: default avatarRémi Duraffort <ivoire@videolan.org>
parent 7cc5ef0d
...@@ -155,7 +155,7 @@ static void * EventDispatcherMainLoop(void * user_data) ...@@ -155,7 +155,7 @@ static void * EventDispatcherMainLoop(void * user_data)
withObject:dataMessage withObject:dataMessage
waitUntilDone: YES]; waitUntilDone: YES];
[pool release]; [pool drain];
} }
return nil; return nil;
} }
...@@ -231,7 +231,7 @@ static void * EventDispatcherMainLoop(void * user_data) ...@@ -231,7 +231,7 @@ static void * EventDispatcherMainLoop(void * user_data)
pthread_mutex_unlock( [self queueLock] ); pthread_mutex_unlock( [self queueLock] );
} }
[pool release]; [pool drain];
} }
- (void)callOnMainThreadObject:(id)aTarget withMethod:(SEL)aSelector withArgumentAsObject: (id)arg - (void)callOnMainThreadObject:(id)aTarget withMethod:(SEL)aSelector withArgumentAsObject: (id)arg
...@@ -250,7 +250,7 @@ static void * EventDispatcherMainLoop(void * user_data) ...@@ -250,7 +250,7 @@ static void * EventDispatcherMainLoop(void * user_data)
pthread_cond_signal( [self signalData] ); pthread_cond_signal( [self signalData] );
pthread_mutex_unlock( [self queueLock] ); pthread_mutex_unlock( [self queueLock] );
[pool release]; [pool drain];
} }
@end @end
......
...@@ -115,7 +115,7 @@ static void HandleMediaMetaChanged(const libvlc_event_t * event, void * self) ...@@ -115,7 +115,7 @@ static void HandleMediaMetaChanged(const libvlc_event_t * event, void * self)
[[VLCEventManager sharedManager] callOnMainThreadObject:self [[VLCEventManager sharedManager] callOnMainThreadObject:self
withMethod:@selector(metaChanged:) withMethod:@selector(metaChanged:)
withArgumentAsObject:[VLCMedia metaTypeToString:event->u.media_meta_changed.meta_type]]; withArgumentAsObject:[VLCMedia metaTypeToString:event->u.media_meta_changed.meta_type]];
[pool release]; [pool drain];
} }
static void HandleMediaDurationChanged(const libvlc_event_t * event, void * self) static void HandleMediaDurationChanged(const libvlc_event_t * event, void * self)
...@@ -126,7 +126,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t * event, void * self ...@@ -126,7 +126,7 @@ static void HandleMediaDurationChanged(const libvlc_event_t * event, void * self
withMethod:@selector(setLength:) withMethod:@selector(setLength:)
withArgumentAsObject:[VLCTime timeWithNumber: withArgumentAsObject:[VLCTime timeWithNumber:
[NSNumber numberWithLongLong:event->u.media_duration_changed.new_duration]]]; [NSNumber numberWithLongLong:event->u.media_duration_changed.new_duration]]];
[pool release]; [pool drain];
} }
static void HandleMediaStateChanged(const libvlc_event_t * event, void * self) static void HandleMediaStateChanged(const libvlc_event_t * event, void * self)
...@@ -137,7 +137,7 @@ static void HandleMediaStateChanged(const libvlc_event_t * event, void * self) ...@@ -137,7 +137,7 @@ static void HandleMediaStateChanged(const libvlc_event_t * event, void * self)
withMethod:@selector(setStateAsNumber:) withMethod:@selector(setStateAsNumber:)
withArgumentAsObject:[NSNumber numberWithInt: withArgumentAsObject:[NSNumber numberWithInt:
LibVLCStateToMediaState(event->u.media_state_changed.new_state)]]; LibVLCStateToMediaState(event->u.media_state_changed.new_state)]];
[pool release]; [pool drain];
} }
static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
...@@ -146,7 +146,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self) ...@@ -146,7 +146,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
[[VLCEventManager sharedManager] callOnMainThreadObject:self [[VLCEventManager sharedManager] callOnMainThreadObject:self
withMethod:@selector(subItemAdded) withMethod:@selector(subItemAdded)
withArgumentAsObject:nil]; withArgumentAsObject:nil];
[pool release]; [pool drain];
} }
/****************************************************************************** /******************************************************************************
......
...@@ -55,7 +55,7 @@ static void HandleMediaDiscovererStarted(const libvlc_event_t * event, void * us ...@@ -55,7 +55,7 @@ static void HandleMediaDiscovererStarted(const libvlc_event_t * event, void * us
[[VLCEventManager sharedManager] callOnMainThreadObject:self [[VLCEventManager sharedManager] callOnMainThreadObject:self
withMethod:@selector(mediaDiscovererStarted) withMethod:@selector(mediaDiscovererStarted)
withArgumentAsObject:nil]; withArgumentAsObject:nil];
[pool release]; [pool drain];
} }
static void HandleMediaDiscovererEnded( const libvlc_event_t * event, void * user_data) static void HandleMediaDiscovererEnded( const libvlc_event_t * event, void * user_data)
...@@ -65,7 +65,7 @@ static void HandleMediaDiscovererEnded( const libvlc_event_t * event, void * use ...@@ -65,7 +65,7 @@ static void HandleMediaDiscovererEnded( const libvlc_event_t * event, void * use
[[VLCEventManager sharedManager] callOnMainThreadObject:self [[VLCEventManager sharedManager] callOnMainThreadObject:self
withMethod:@selector(mediaDiscovererEnded) withMethod:@selector(mediaDiscovererEnded)
withArgumentAsObject:nil]; withArgumentAsObject:nil];
[pool release]; [pool drain];
} }
......
...@@ -58,7 +58,7 @@ static void HandleMediaListItemAdded(const libvlc_event_t * event, void * user_d ...@@ -58,7 +58,7 @@ static void HandleMediaListItemAdded(const libvlc_event_t * event, void * user_d
[VLCMedia mediaWithLibVLCMediaDescriptor:event->u.media_list_item_added.item], @"media", [VLCMedia mediaWithLibVLCMediaDescriptor:event->u.media_list_item_added.item], @"media",
[NSNumber numberWithInt:event->u.media_list_item_added.index], @"index", [NSNumber numberWithInt:event->u.media_list_item_added.index], @"index",
nil]]]; nil]]];
[pool release]; [pool drain];
} }
static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * user_data) static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * user_data)
...@@ -68,7 +68,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use ...@@ -68,7 +68,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
[[VLCEventManager sharedManager] callOnMainThreadObject:self [[VLCEventManager sharedManager] callOnMainThreadObject:self
withMethod:@selector(mediaListItemRemoved:) withMethod:@selector(mediaListItemRemoved:)
withArgumentAsObject:[NSNumber numberWithInt:event->u.media_list_item_deleted.index]]; withArgumentAsObject:[NSNumber numberWithInt:event->u.media_list_item_deleted.index]];
[pool release]; [pool drain];
} }
@implementation VLCMediaList @implementation VLCMediaList
......
...@@ -79,7 +79,7 @@ static void HandleMediaTimeChanged(const libvlc_event_t * event, void * self) ...@@ -79,7 +79,7 @@ static void HandleMediaTimeChanged(const libvlc_event_t * event, void * self)
[[VLCEventManager sharedManager] callOnMainThreadDelegateOfObject:self [[VLCEventManager sharedManager] callOnMainThreadDelegateOfObject:self
withDelegateMethod:@selector(mediaPlayerTimeChanged:) withDelegateMethod:@selector(mediaPlayerTimeChanged:)
withNotificationName:VLCMediaPlayerTimeChanged]; withNotificationName:VLCMediaPlayerTimeChanged];
[pool release]; [pool drain];
} }
static void HandleMediaPositionChanged(const libvlc_event_t * event, void * self) static void HandleMediaPositionChanged(const libvlc_event_t * event, void * self)
...@@ -89,7 +89,7 @@ static void HandleMediaPositionChanged(const libvlc_event_t * event, void * self ...@@ -89,7 +89,7 @@ static void HandleMediaPositionChanged(const libvlc_event_t * event, void * self
[[VLCEventManager sharedManager] callOnMainThreadObject:self [[VLCEventManager sharedManager] callOnMainThreadObject:self
withMethod:@selector(mediaPlayerPositionChanged:) withMethod:@selector(mediaPlayerPositionChanged:)
withArgumentAsObject:[NSNumber numberWithFloat:event->u.media_player_position_changed.new_position]]; withArgumentAsObject:[NSNumber numberWithFloat:event->u.media_player_position_changed.new_position]];
[pool release]; [pool drain];
} }
static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void * self) static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void * self)
...@@ -120,7 +120,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void * ...@@ -120,7 +120,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
withDelegateMethod:@selector(mediaPlayerStateChanged:) withDelegateMethod:@selector(mediaPlayerStateChanged:)
withNotificationName:VLCMediaPlayerStateChanged]; withNotificationName:VLCMediaPlayerStateChanged];
[pool release]; [pool drain];
} }
...@@ -132,7 +132,7 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s ...@@ -132,7 +132,7 @@ static void HandleMediaPlayerMediaChanged(const libvlc_event_t * event, void * s
withMethod:@selector(mediaPlayerMediaChanged:) withMethod:@selector(mediaPlayerMediaChanged:)
withArgumentAsObject:[VLCMedia mediaWithLibVLCMediaDescriptor:event->u.media_player_media_changed.new_media]]; withArgumentAsObject:[VLCMedia mediaWithLibVLCMediaDescriptor:event->u.media_player_media_changed.new_media]];
[pool release]; [pool drain];
} }
......
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