From 4dc7d7199e1cc1b9f852021868dae78245d79358 Mon Sep 17 00:00:00 2001 From: vspader Date: Fri, 14 Apr 2006 12:59:29 +0000 Subject: [PATCH] Fixed DND playlist bug where dragging between the playlist could cause a crash. --- Playlist/DNDArrayController.m | 2 ++ Playlist/PlaylistController.m | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Playlist/DNDArrayController.m b/Playlist/DNDArrayController.m index 1bc74f3fb..d7ed8b74b 100755 --- a/Playlist/DNDArrayController.m +++ b/Playlist/DNDArrayController.m @@ -111,8 +111,10 @@ NSString *MovedRowsType = @"MOVED_ROWS_TYPE"; insertIndex -= 1; } object = [objects objectAtIndex:removeIndex]; + [object retain]; [self removeObjectAtArrangedObjectIndex:removeIndex]; [self insertObject:object atArrangedObjectIndex:insertIndex]; + [object release]; index = [indexSet indexLessThanIndex:index]; } diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index 278938aca..fbf95fc57 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -170,7 +170,9 @@ if ([info draggingSource] == tableView) { //DNDArrayController handles moving...still need to update the uhm...indices + NSLog(@"Archive stuff"); NSArray *rows = [NSKeyedUnarchiver unarchiveObjectWithData:[[info draggingPasteboard] dataForType: MovedRowsType]]; + NSLog(@"Whatever"); NSIndexSet *indexSet = [self indexSetFromRows:rows]; int firstIndex = [indexSet firstIndex]; if (firstIndex > row)