Re: Headless Cocoa/Java app - autorelease
Re: Headless Cocoa/Java app - autorelease
- Subject: Re: Headless Cocoa/Java app - autorelease
- From: Michael Hall <email@hidden>
- Date: Tue, 3 May 2005 02:36:24 -0700 (PDT)
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
--- String Larson <email@hidden> wrote:
> private doStuff(){
> NSImage image = new NSImage(new
> URL("http://someplace..."));
> // do stuff w/image.
> return;
> }
> }
>
> Everything should be ok (if not right away, at least
> on the next GC),
> no?
>
You seem to be assuming java is where the leak
resides? Since this is a bridged NSImage and not a
java image I would tend to assume the other way. The
Cocoa side is probably whats leaking. For Java the
NSImage above is local scope to the doStuff() method,
meaning temporary, and eligible for gc as soon as that
method ends.
For Cocoa don't reference counts figure into the
object retention somehow? Or should the autorelease
force the object to release irregardless?
There was mention of problems in synchronizing memory
management across the bridge a while back on java-dev.
I think that concerned retention in some sort of
container like NSDictionary or something. Might be
misremembering. I did locate documentation at the time
indicating that some effort had been put into getting
the memory models to mesh. This indicated to me at
least that where it didn't work could be considered a
bug and rate a bug report.
After double checking that the object should be freed
by the rules on both sides of the bridge and if I was
pretty sure it wasn't being released I'd most likely
file the bug report.
As per earlier I would not try to wrap JBoss with
Cocoa Java - pretty much period.
Mike Hall
http://www.spacestar.net/users/mikehall
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
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