andrep / hoc

Automatically exported from code.google.com/p/hoc
8 stars 1 forks source link

Do not completely override retain/release #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
NSManagedObject does some kind of magic with its retain/release which breaks 
when HOC 
overrides them. (The NSManagedObject documentation also specifically states 
that those methods 
"must not" be overridden).  Unfortunately this is a relatively difficult thing 
to create a test case for,  
but "in the wild" what happens is the object gets prematurely deallocated, 
usually upon the first 
edit to a managed object after loading from a persistent store.

I have a patch at home that fixes the problem by changing the behavior of HOC's 
retain/release 
implementations to use calls to [super retain], [super release], and [super 
retainCount], however I 
don't know whether this would be considered an unnecessary performance hit to 
do so in all 
cases.  Should I push the change or just post a patch here for review?

Original issue reported on code.google.com by james.c...@usma.edu on 29 Dec 2008 at 4:15

GoogleCodeExporter commented 9 years ago
Haven't heard anything on this, so I'm going ahead and pushing to the objc2 
branch for now.  For the record, I 
know that I've made a bit of an unreadable mess of HOC.ID.importArgument' - 
I've tried a couple times at 
cleaning it up, but haven't found a version I like yet.

Original comment by james.c...@usma.edu on 10 Jan 2009 at 12:56

GoogleCodeExporter commented 9 years ago
Finally got around to cleaning up HOC.ID.importArgument'.  If someone would 
review this work for inclusion in 
the trunk, I'd appreciate it.

I think that in general this change is "more correct" than what was happening 
before, but digging so deep into 
the guts of the class construction and marshalling stuff makes me a bit nervous 
(especially considering I don't 
have a GNUStep system, or even an older Mac OS to test on), so I won't push it 
to trunk just in case I've totally 
misunderstood how something was supposed to work.

Original comment by james.c...@usma.edu on 12 Aug 2009 at 1:31

GoogleCodeExporter commented 9 years ago
Just got around to have a first look at it yesterday, my first impression is 
positive. I will 
have another look and try my best to find something wrong with it ;-).

Thanks for the effort!

Original comment by aut...@gmail.com on 12 Aug 2009 at 2:14

GoogleCodeExporter commented 9 years ago
Closing this out since it appears to have been taken care of at some point.

Original comment by james.c...@usma.edu on 28 Mar 2012 at 1:01