Re: Java-Bridge errors
Re: Java-Bridge errors
- Subject: Re: Java-Bridge errors
- From: Chris Backas <email@hidden>
- Date: Fri, 15 Nov 2002 23:13:51 -0500 (EST)
- Priority: Normal
Hi Christoph,
This isn't a bug in the bridge, but in your Java code; most likely caused by a tricky thing that can occur as a result of mixing the two languages.
If you return an object created on the Java side of the bridge back to Cocoa (IE: Returned from a call to a delegate) or if you pass a Java-created object to a Cocoa object, you must keep the pointer SOMEWHERE
on the Java side. The Java VM does not know about Cocoa; if it thinks that the object is no longer in use from Java's point of view, the object will be garbage collected (destroyed), and when Cocoa comes looking
for it, you will get the error you listed.
If you need further explanation, just ask. Good luck!
Chris Backas
>
Hi,
>
the application I am currently working on crashes frequently dumping
>
this error:
>
>
ObjCJava FATAL:
>
jobjc_lookupObjCObject(): returning garbage collected java ref for objc
>
object of class myObject
>
ObjCJava Exit
>
>
myApp has exited with status 255.
>
>
Can I do anything about it or is it a bug in the cocoa java framework?
>
Tia.
>
Christoph
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.