From 9413b6ec1a4aa1bd23cca54a3f1ff83feb07883a Mon Sep 17 00:00:00 2001 From: vspader Date: Fri, 14 Apr 2006 01:24:32 +0000 Subject: [PATCH] Fixed crash when file changed and pe was released --- Playlist/PlaylistController.m | 6 +++++- Playlist/PlaylistEntry.m | 2 ++ Sound/BufferChain.m | 2 ++ Sound/SoundController.m | 4 +++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Playlist/PlaylistController.m b/Playlist/PlaylistController.m index d18984ced..278938aca 100644 --- a/Playlist/PlaylistController.m +++ b/Playlist/PlaylistController.m @@ -206,11 +206,14 @@ { double tt=0; - NSEnumerator *enumerator = [[self arrangedObjects] objectEnumerator]; + NSEnumerator *enumerator = [[self content] objectEnumerator]; PlaylistEntry* pe; while (pe = [enumerator nextObject]) { + NSLog(@"Updating :%i", pe); + NSLog(@"Updating :%@", pe); tt += [pe length]; + NSLog(@"UpdateD"); } int sec = (int)(tt/1000.0); @@ -254,6 +257,7 @@ [indexes getIndexes:indexBuffer maxCount:[indexes count] inIndexRange:nil]; for (i = 0; i < [indexes count]; i++) { + NSLog(@"REMOVING FROM INDEX: %i", indexBuffer[i]); [a addObject:[[self arrangedObjects] objectAtIndex:(indexBuffer[i])]]; } diff --git a/Playlist/PlaylistEntry.m b/Playlist/PlaylistEntry.m index f16dbef0e..7a890c6f4 100644 --- a/Playlist/PlaylistEntry.m +++ b/Playlist/PlaylistEntry.m @@ -26,6 +26,8 @@ - (void)dealloc { + NSLog(@"DEALLOCATING A PLAYLIST ENTRY: %@", display); + [filename release]; [display release]; diff --git a/Sound/BufferChain.m b/Sound/BufferChain.m index f8ffbe602..40f375d13 100644 --- a/Sound/BufferChain.m +++ b/Sound/BufferChain.m @@ -63,7 +63,9 @@ - (void)dealloc { + NSLog(@"Releasing playlistEntry: %i", [playlistEntry retainCount]); [playlistEntry release]; + NSLog(@"Released playlistEntry: %i", [playlistEntry retainCount]); [inputNode release]; [converterNode release]; diff --git a/Sound/SoundController.m b/Sound/SoundController.m index 940a25e1c..02ac11fbb 100644 --- a/Sound/SoundController.m +++ b/Sound/SoundController.m @@ -119,6 +119,7 @@ - (void)setNextEntry:(PlaylistEntry *)pe { [pe retain]; + NSLog(@"Releasing: %@", [pe display]); [nextEntry release]; nextEntry = pe; } @@ -151,7 +152,8 @@ BufferChain *newChain = nil; nextEntry = [sender playlistEntry]; - + [nextEntry retain]; + do { [newChain release]; [self requestNextEntry:nextEntry];