Sebastian Kloska writes:
> > In an attempt to reduce the calls to JvNewStringUTF I was trying
> to store the colum names I like it access in an array of
> 'java::lang::String *', but after initializatons (as a none static
> class array) and befor using these pointers in another class method
> the strings seem to be gone. So it seems I do not realy understand
> the concept of how long I'm alowed to hold a (valid ?) reference
> to an JAVA object (e.g. String) and that somehow the garbage
> collector is 'stealing' these from me....
The gcj garbage collector will recycle memory when it determines that
there are no live references to it. The gc won't look inside
structures allocated by malloc() or the C++ runtime library's new().
If you want to make an array of 'java::lang::String *' you had better
make it a JArray<jstring>, not a C++ array, and you'd better make sure
that a pointer to that jarray is live in a Java object somewhere, or
the strings will be deallocated.
Andrew.