Laurent Sansonetti
lsans****@apple*****
Mon Aug 6 07:37:06 JST 2007
On Aug 6, 2007, at 12:10 AM, Satoshi Nakagawa wrote: > Hi. > > I have investigated a problem, NSOutlineView#selectedRowIndexes > sometimes > returns NSCFString not NSIndexSet. > > #<OSX::NSCFString:0x3c89b2 class='NSIndexSet' id=0x11edfb0> > > In the result, it seems a problem around the oc2rb cache. > > I noticed that NSCFString#dealloc is never called, therefore > NSCFString entries > in the oc2rb cache won't be cleared, even when the NSCFString object > had been > deallocated actually. > > In my observation, an object of a class in a class cluster is not > deallocated through > NSObject#dealloc. True, basically all objects that are implemented through CF. > So I added a check, if an object is in a class cluster, then give up > to register it > to the oc2rb cache. It works good in my testing. > > I committed the fix as r1986. This isn't good, because you're missing lots of "class cluster" types. And it's impossible to know them in advance, because any framework could introduce some. Also, this means that NSString objects for example won't be cached, which is a problem with for example NSOutlineView which expects to always get the same object values from its data source. It might be better to find another fix for this bug. I remember that before you added the dealloc hook, I had a solution. Maybe we can revert this solution for this kind of objects. Laurent