Java Object allocation from C++ and references?
Andrew Haley
aph@redhat.com
Tue Feb 3 14:42:00 GMT 2004
Ben Martin writes:
> is it correct to assume that if one is to use C++ code and create an
> object implemented in Java code, for example, java::lang::String, then
> the C++ code creating the new String* does not call delete?
That's right.
> I have rolled rpms for jakarta-lucene using gcj from Fedora
> development and using C++ smart pointers to manage
> java::lang::string objects seems to work but when I use a C++ smart
> pointer on one of the Lucene java objects the program crashes on
> the delete of that object.
You mustn't do that. Let the garbage collector do the job.
Andrew.
More information about the Java
mailing list