Crash in removeObserver
Crash in removeObserver
- Subject: Crash in removeObserver
- From: Gideon King <email@hidden>
- Date: Fri, 17 Mar 2006 10:54:47 +1000
Any ideas on what would cause an intermittent crash in
[[NSNotificationCenter defaultCenter] removeObserver:self];
which I have in my dealloc method of my NSDocument subclass?
I have not been able to reproduce it here, but a few users have
reported the issue - one saying that he gets the crash 30% of the
time he closes a document. The stack trace is:
Exception: EXC_BAD_ACCESS (0x0001)
Codes: KERN_INVALID_ADDRESS (0x0001) at 0x419e0030
Thread 0 Crashed:
0 libobjc.A.dylib 0x909bf140 objc_msgSend + 64
1 com.novamind.app.NovaMind 0x0000753c -[NovaMindDocument
dealloc] + 64 (NovaMindDocument.m:1592)
2 com.apple.Foundation 0x928f201c
__delayedPerformCleanup + 48
3 com.apple.CoreFoundation 0x907840f4
CFRunLoopTimerInvalidate + 400
4 com.apple.CoreFoundation 0x90770b44 __CFRunLoopDoTimer + 272
5 com.apple.CoreFoundation 0x9075d464 __CFRunLoopRun + 1680
6 com.apple.CoreFoundation 0x9075ca18 CFRunLoopRunSpecific +
268
7 com.apple.HIToolbox 0x9318f1e0
RunCurrentEventLoopInMode + 264
8 com.apple.HIToolbox 0x9318e874 ReceiveNextEventCommon
+ 380
9 com.apple.HIToolbox 0x9318e6e0
BlockUntilNextEventMatchingListInMode + 96
10 com.apple.AppKit 0x9366c104 _DPSNextEvent + 384
11 com.apple.AppKit 0x9366bdc8 -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] + 116
12 com.apple.AppKit 0x9366830c -[NSApplication run] +
472
13 com.apple.AppKit 0x93758e68 NSApplicationMain + 452
14 com.novamind.app.NovaMind 0x0000264c _start + 340 (crt.c:272)
15 com.novamind.app.NovaMind 0x000024f4 start + 60
I've seen some other postings on similar topics, but none of them
seem to match my situation.
Does it matter whether
[[self undoManager] removeAllActionsWithTarget:self];
goes before or after the removeObserver call in the dealloc method?
TIA
Gideon King
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden