Skip to content
Browse files

After an item is collapsed, free memory of children. It's fast enough.

  • Loading branch information...
1 parent bf804fd commit 79a90e933fbd7c18970bd173679cba22debae843 @alloy committed Sep 27, 2012
Showing with 9 additions and 2 deletions.
  1. +9 −2 src/MacVim/MMFileBrowserController.m
View
11 src/MacVim/MMFileBrowserController.m
@@ -150,7 +150,7 @@ - (NSString *)description;
//}
static void
-MMFileBrowserFSItemStackIncrease(NSArray *stack,
+MMFileBrowserFSItemStackIncrease(NSMutableArray *stack,
MMFileBrowserFSItem *newItem,
NSMutableArray **newChildren,
BOOL *checkChildrenForExistingItem)
@@ -477,8 +477,8 @@ - (void)mouseDown:(NSEvent *)event {
NSInteger row = [self rowAtPoint:[self convertPoint:event.locationInWindow fromView:nil]];
MMFileBrowserFSItem *item = [self itemAtRow:row];
+ // TODO check if this can be done from the ‘will expand’ delegate method
if (![item isLeaf] && ![self isItemExpanded:item]) {
- // We load directory contents, recursive or not recursive, just-in-time.
if (event.modifierFlags & NSAlternateKeyMask) {
// Recursive to any depth.
[item loadChildrenRecursive:YES expandedChildrenOnly:NO];
@@ -1133,6 +1133,13 @@ - (BOOL)outlineView:(NSOutlineView *)outlineView
}
}
+- (void)outlineViewItemDidCollapse:(NSNotification *)notification;
+{
+ MMFileBrowserFSItem *item = [notification.userInfo objectForKey:@"NSObject"];
+ // Free memory
+ item.children = nil;
+}
+
// Actions
// =======

0 comments on commit 79a90e9

Please sign in to comment.
Something went wrong with that request. Please try again.