Commit 9b675d98 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

VLCMediaList.m: Don't mess between node hierachical and hierarchical cached...

VLCMediaList.m: Don't mess between node hierachical and hierarchical cached copy of the MediaListAspect.
parent b27fff6b
...@@ -46,6 +46,7 @@ extern NSString * VLCMediaListItemDeleted; ...@@ -46,6 +46,7 @@ extern NSString * VLCMediaListItemDeleted;
NSMutableArray *cachedMedia; /* We need that private copy because of Cocoa Bindings, that need to be working on first thread */ NSMutableArray *cachedMedia; /* We need that private copy because of Cocoa Bindings, that need to be working on first thread */
VLCMediaListAspect * flatAspect; VLCMediaListAspect * flatAspect;
VLCMediaListAspect * hierarchicalAspect; VLCMediaListAspect * hierarchicalAspect;
VLCMediaListAspect * hierarchicalNodeAspect;
} }
/* Properties */ /* Properties */
......
...@@ -93,7 +93,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use ...@@ -93,7 +93,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
// Initialize internals to defaults // Initialize internals to defaults
cachedMedia = [[NSMutableArray alloc] init]; cachedMedia = [[NSMutableArray alloc] init];
delegate = flatAspect = hierarchicalAspect = nil; delegate = flatAspect = hierarchicalAspect = hierarchicalNodeAspect = nil;
[self initInternalMediaList]; [self initInternalMediaList];
} }
return self; return self;
...@@ -123,6 +123,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use ...@@ -123,6 +123,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
[cachedMedia release]; [cachedMedia release];
[flatAspect release]; [flatAspect release];
[hierarchicalAspect release]; [hierarchicalAspect release];
[hierarchicalNodeAspect release];
[super dealloc]; [super dealloc];
} }
...@@ -229,12 +230,12 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use ...@@ -229,12 +230,12 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
- (VLCMediaListAspect *)hierarchicalNodeAspect - (VLCMediaListAspect *)hierarchicalNodeAspect
{ {
if( hierarchicalAspect ) if( hierarchicalNodeAspect )
return hierarchicalAspect; return hierarchicalNodeAspect;
libvlc_media_list_view_t * p_mlv = libvlc_media_list_hierarchical_node_view( p_mlist, NULL ); libvlc_media_list_view_t * p_mlv = libvlc_media_list_hierarchical_node_view( p_mlist, NULL );
hierarchicalAspect = [[VLCMediaListAspect mediaListAspectWithLibVLCMediaListView: p_mlv andMediaList:self] retain]; hierarchicalNodeAspect = [[VLCMediaListAspect mediaListAspectWithLibVLCMediaListView: p_mlv andMediaList:self] retain];
libvlc_media_list_view_release( p_mlv ); libvlc_media_list_view_release( p_mlv );
return hierarchicalAspect; return hierarchicalNodeAspect;
} }
- (VLCMediaListAspect *)flatAspect - (VLCMediaListAspect *)flatAspect
......
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