Java objects obtained by c++: are they garbage collected?

Yuri yuri@rawbw.com
Fri Oct 16 19:17:00 GMT 2009


David Daney wrote:
> Yuri wrote:
>> I compiled several Java classes into a shared library and call it's 
>> methods from C++.
>> Some of these methods return Java objects.
>>
>> I wonder do I have to do anything special about them in order for 
>> them to get garbage collected?
>>
>
> If you use the CNI facilities to start the runtime and do the calling, 
> everything should just work (including garbage collection).

I initialize the runtime using CNI and call methods using dlsym + call 
of that symbol.

Yuri



More information about the Java mailing list