On Win32 platforms using the Jace DLL,
jace::helper::onThreadDestruction() is called each time
a thread runs down. The first thing this function does
is call getJavaVM().
If the Java VM has not been initialized yet,
getJavaVM() throws an exception. This is caught, logged
to std::cerr, and otherwise ignored by Jace's DllMain.
However, the overhead and stderr noise is unnecessary.
In our application, the Java runtime is initialized
only when (and if) a specific subset of the program's
functionality is first used.
This can be easily fixed by changing the call to
getJavaVM() with javaVM, and returning immediately if
it is NULL.
Logged In: YES
user_id=358502
Let me rephrase the last paragraph:
This can be easily fixed by testing javaVM, and returning
immediately if it is NULL. (There's no particular reason to
use the getJavaVM() accessor once the reference is guarded
this way, since onThreadDestruction() lives in the same
module where javaVM is defined.)
BTW, onThreadDestruction() is in file JNIHelper.cpp.