Commit 3fcf4058 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 3349fb0b
......@@ -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 */
VLCMediaListAspect * flatAspect;
VLCMediaListAspect * hierarchicalAspect;
VLCMediaListAspect * hierarchicalNodeAspect;
}
/* Properties */
......
......@@ -93,7 +93,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
// Initialize internals to defaults
cachedMedia = [[NSMutableArray alloc] init];
delegate = flatAspect = hierarchicalAspect = nil;
delegate = flatAspect = hierarchicalAspect = hierarchicalNodeAspect = nil;
[self initInternalMediaList];
}
return self;
......@@ -123,6 +123,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
[cachedMedia release];
[flatAspect release];
[hierarchicalAspect release];
[hierarchicalNodeAspect release];
[super dealloc];
}
......@@ -229,12 +230,12 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
- (VLCMediaListAspect *)hierarchicalNodeAspect
{
if( hierarchicalAspect )
return hierarchicalAspect;
if( hierarchicalNodeAspect )
return hierarchicalNodeAspect;
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 );
return hierarchicalAspect;
return hierarchicalNodeAspect;
}
- (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