Bindings crash - _NSKeyValueObservationInfoCreateByRemoving calls CFRetain(NULL)
Bindings crash - _NSKeyValueObservationInfoCreateByRemoving calls CFRetain(NULL)
- Subject: Bindings crash - _NSKeyValueObservationInfoCreateByRemoving calls CFRetain(NULL)
- From: Jim Correia <email@hidden>
- Date: Fri, 15 Jul 2005 19:45:16 -0400
This particular crash/backtrace has come up before. The circumstances
here are somewhat different, and I'm not sure there was ever a
conclusive answer as to what the problem was.
By way of background, I have a CoreData application that uses
bindings. In order to keep edits/undo per window, I have (in the
demo) 2 managed object contexts - one for the people editor, one for
the label editor. When one saves, the other refaults its objects and
ask its controllers to fetch (so they pull changes as well.)
After a certain sequence of steps, the application will crash because
_NSKeyValueObservationInfoCreateByRemoving
calls CFRetain(NULL).
Full example at:
http://homepage.mac.com/jimcorreia/tmp/TwoManagedObjectContexts.zip
Steps to reproduce included in Instructions.txt in the archive, or
here. Does anyone have any idea what, if anything, I've done wrong
here? Is this a bindings bug? Is there a workaround?
Thanks,
Jim
Steps to reproduce:
1. Launch the application. In the labels window create 2 labels.
Name them
red and blue. Click Save.
2. In the people window create 2 people. Assign the red label to
one, the
blue label to the other. Click Save.
3. Quit the application.
4. Launch the application. In the label window select both labels.
Click
Remove. Click Save.
5. Undo, click Save.
6. Undo, click Save. You will crash at this point with the following
backtrace:
#0 0x9072de24 in CFRetain
#1 0x929034b0 in _NSKeyValueObservationInfoCreateByRemoving
#2 0x92903288 in -[NSObject(NSKeyValueObserverRegistration)
_removeObserver:forProperty:]
#3 0x92903178 in -[NSObject(NSKeyValueObserverRegistration)
removeObserver:forKeyPath:]
#4 0x929030c8 in -[NSObject(NSKeyValueObserverRegistration)
removeObserver:forKeyPath:]
#5 0x93880474 in -[_NSModelObservingTracker
_registerOrUnregister:observerNotificationsForModelObject:]
#6 0x93877ef4 in -[_NSModelObservingTracker
clearAllModelObjectObserving]
#7 0x93877da0 in -[_NSModelObservingTracker
setIndexReferenceModelObjectArray:clearAllModelObjectObserving:]
#8 0x9387a098 in -[NSTableBinder _updateContent]
#9 0x93879f1c in -[NSTableBinder
_observeValueForKeyPath:ofObject:context:]
#10 0x93879d00 in -[NSTableBinder
observeValueForKeyPath:ofObject:change:context:]
#11 0x92903a94 in -[NSObject(NSKeyValueObservingPrivate)
_notifyObserversForKeyPath:change:]
#12 0x9387dd44 in -[NSController _notifyObserversForKeyPath:change:]
#13 0x9387db5c in -[NSArrayController
didChangeValuesForArrangedKeys:objectKeys:indexKeys:]
#14 0x93b09760 in -[_NSManagedProxy _managedObjectsChangedInContext:]
#15 0x9287c878 in _nsnote_callback
#16 0x90772740 in __CFXNotificationPost
#17 0x9076a864 in _CFXNotificationPostNotification
#18 0x92866c80 in -[NSNotificationCenter
postNotificationName:object:userInfo:]
#19 0x93feb0b0 in -[NSManagedObjectContext
(_NSInternalNotificationHandling)
_postObjectsDidChangeNotificationWithUserInfo:]
#20 0x93feb034 in -[NSManagedObjectContext
(_NSInternalChangeProcessing)
_createAndPostChangeNotification:withDeletions:withUpdates:withRefreshes
:]
#21 0x93febf4c in -[NSManagedObjectContext
(_NSInternalChangeProcessing)
_postRefreshedObjectsNotificationAndClearList]
#22 0x93fea280 in -[NSManagedObjectContext
(_NSInternalChangeProcessing) _processRecentChanges:]
#23 0x93feb760 in -[NSManagedObjectContext
executeFetchRequest:error:]
#24 0x93b04d08 in -[NSArrayController(NSManagedController)
_performFetchWithRequest:merge:error:]
#25 0x93b08344 in -[NSObjectController(NSManagedController)
fetchWithRequest:merge:error:]
#26 0x93b083d0 in -[NSObjectController(NSManagedController)
_executeFetch:didCommitSuccessfully:actionSender:]
#27 0x909b2214 in objc_msgSendv
#28 0x92878a28 in -[NSInvocation invoke]
#29 0x92878fd8 in -[NSInvocation invokeWithTarget:]
#30 0x93ae2844 in _NSSendCommitEditingSelector
#31 0x93b05d5c in -[NSController
_controllerEditor:didCommit:contextInfo:]
#32 0x909b2214 in objc_msgSendv
#33 0x92878a28 in -[NSInvocation invoke]
#34 0x92878fd8 in -[NSInvocation invokeWithTarget:]
#35 0x92887998 in __NSFireDelayedPerform
#36 0x9075edb0 in __CFRunLoopDoTimer
#37 0x9074b728 in __CFRunLoopRun
#38 0x9074acdc in CFRunLoopRunSpecific
#39 0x93123be0 in RunCurrentEventLoopInMode
#40 0x931231ec in ReceiveNextEventCommon
#41 0x931230e0 in BlockUntilNextEventMatchingListInMode
#42 0x9362c1a4 in _DPSNextEvent
#43 0x9362be68 in -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:]
#44 0x936283cc in -[NSApplication run]
#45 0x93718c1c in NSApplicationMain
#46 0x000025d8 in main at main.m:13
_______________________________________________
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