FROM : Bill
DATE : Mon Mar 03 04:50:05 2008
On Mar 2, 2008, at 5:35 PM, Ben Trumbull wrote:
>> My question is, why would changing a property value cause another
>> property to have its retain count increase?
>
> No idea. Why don't you run it in gdb and break on the -retain
> method and get some stack traces ?
> This works best if the class you're debugging (in this case the
> value window controller) has a custom retain/release method that you
> can break on instead of NSObject's etc. If it doesn't, you can
> trivially make one by adding a category on it and putting -retain/-
> release/-autorelease methods on it that simply call super.
Good idea. Here's the stack trace:
#0 0x000029aa in -[NSWindowController(MainWindow) retain] at
MainWindowController.m:35
#1 0x92dfa378 in -[NSManagedObject(_NSInternalMethods)
_newPropertiesForRetainedTypes:andCopiedTypes:preserveFaults:]
#2 0x92dfa250 in -[NSManagedObject(_NSInternalMethods) _allProperties]
#3 0x92dfa185 in -[NSManagedObjectContext(_NSInternalChangeProcessing)
_establishEventSnapshotsForObject:]
#4 0x92dfd516 in _PFFastMOCObjectWillChange
#5 0x92dfb4e3 in -[NSManagedObject willChangeValueForKey:]
#6 0x00021a6c in -[Window setOpenAtLaunch:] at Window.m:117
Not sure what to make of it, nor why setting the property openAtLaunch
increments the retain count for the window controller property.
>> So by the time the user wants to delete a managed object from the
>> list, the window controller could have a high
>> value and is never released!
>
> This sounds like a hypothetical concern as opposed to an empirically
> observed leak. Each retainer is obliged to balance itself out
> eventually. That's not your problem. Generally speaking, the
> retain count is an implementation dependent value and not really
> meaningful API.
I made the statement because I have an NSLog statement in the window
controller dealloc method. It never gets executed unless the retain
count is 0.
Thanks,
Bill
DATE : Mon Mar 03 04:50:05 2008
On Mar 2, 2008, at 5:35 PM, Ben Trumbull wrote:
>> My question is, why would changing a property value cause another
>> property to have its retain count increase?
>
> No idea. Why don't you run it in gdb and break on the -retain
> method and get some stack traces ?
> This works best if the class you're debugging (in this case the
> value window controller) has a custom retain/release method that you
> can break on instead of NSObject's etc. If it doesn't, you can
> trivially make one by adding a category on it and putting -retain/-
> release/-autorelease methods on it that simply call super.
Good idea. Here's the stack trace:
#0 0x000029aa in -[NSWindowController(MainWindow) retain] at
MainWindowController.m:35
#1 0x92dfa378 in -[NSManagedObject(_NSInternalMethods)
_newPropertiesForRetainedTypes:andCopiedTypes:preserveFaults:]
#2 0x92dfa250 in -[NSManagedObject(_NSInternalMethods) _allProperties]
#3 0x92dfa185 in -[NSManagedObjectContext(_NSInternalChangeProcessing)
_establishEventSnapshotsForObject:]
#4 0x92dfd516 in _PFFastMOCObjectWillChange
#5 0x92dfb4e3 in -[NSManagedObject willChangeValueForKey:]
#6 0x00021a6c in -[Window setOpenAtLaunch:] at Window.m:117
Not sure what to make of it, nor why setting the property openAtLaunch
increments the retain count for the window controller property.
>> So by the time the user wants to delete a managed object from the
>> list, the window controller could have a high
>> value and is never released!
>
> This sounds like a hypothetical concern as opposed to an empirically
> observed leak. Each retainer is obliged to balance itself out
> eventually. That's not your problem. Generally speaking, the
> retain count is an implementation dependent value and not really
> meaningful API.
I made the statement because I have an NSLog statement in the window
controller dealloc method. It never gets executed unless the retain
count is 0.
Thanks,
Bill
| Related mails | Author | Date |
|---|---|---|
| Kimo | Mar 2, 21:32 | |
| Ben Trumbull | Mar 3, 02:35 | |
| Bill | Mar 3, 04:50 | |
| Ben Trumbull | Mar 4, 22:06 | |
| Bill | Mar 4, 22:46 |






Cocoa mail archive

