Commit 4e0a6553 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

MacOSX/Framework/VLCMediaListAspect.m: Alloc an autoreleasePool where needed.

parent c4057d16
...@@ -50,27 +50,35 @@ ...@@ -50,27 +50,35 @@
/* libvlc event callback */ /* libvlc event callback */
static void HandleMediaListViewItemAdded(const libvlc_event_t *event, void *user_data) static void HandleMediaListViewItemAdded(const libvlc_event_t *event, void *user_data)
{ {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
id self = user_data; id self = user_data;
int index = event->u.media_list_view_item_added.index; int index = event->u.media_list_view_item_added.index;
[self didChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"Media"]; [self didChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"Media"];
[pool release];
} }
static void HandleMediaListViewWillAddItem(const libvlc_event_t *event, void *user_data) static void HandleMediaListViewWillAddItem(const libvlc_event_t *event, void *user_data)
{ {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
id self = user_data; id self = user_data;
int index = event->u.media_list_view_will_add_item.index; int index = event->u.media_list_view_will_add_item.index;
[self willChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"Media"]; [self willChange:NSKeyValueChangeInsertion valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"Media"];
[pool release];
} }
static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void * user_data) static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void * user_data)
{ {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
id self = user_data; id self = user_data;
int index = event->u.media_list_view_will_add_item.index; int index = event->u.media_list_view_will_add_item.index;
[self didChange:NSKeyValueChangeRemoval valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"Media"]; [self didChange:NSKeyValueChangeRemoval valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"Media"];
[pool release];
} }
static void HandleMediaListViewWillDeleteItem(const libvlc_event_t *event, void *user_data) static void HandleMediaListViewWillDeleteItem(const libvlc_event_t *event, void *user_data)
{ {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
id self = user_data; id self = user_data;
int index = event->u.media_list_view_will_add_item.index; int index = event->u.media_list_view_will_add_item.index;
[self willChange:NSKeyValueChangeRemoval valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"Media"]; [self willChange:NSKeyValueChangeRemoval valuesAtIndexes:[NSIndexSet indexSetWithIndex:index] forKey:@"Media"];
[pool release];
} }
@implementation VLCMediaListAspect @implementation VLCMediaListAspect
......
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