瀏覽代碼

VLCMediaList.m: Don't mess between node hierachical and hierarchical cached copy of the MediaListAspect.

Pierre d'Herbemont 17 年之前
父節點
當前提交
3fcf405822
共有 2 個文件被更改,包括 7 次插入5 次删除
  1. 1 0
      Headers/Public/VLCMediaList.h
  2. 6 5
      Sources/VLCMediaList.m

+ 1 - 0
Headers/Public/VLCMediaList.h

@@ -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 */

+ 6 - 5
Sources/VLCMediaList.m

@@ -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