On Fri, 9 Apr 2021 at 13:46, antonio <anto...@vieiro.net> wrote: > The stack trace doesn't suggest a not attached thread by itself. > > The stack trace simply allows us to follow the calls being invoked, and > a look at the source code is what suggests that env->AttachCurrentThread > (or AttachCurrentThreadAsDaemon) is not being invoked. Attaching native > threads to the proper JVM threads is mandatory (so the JVM's JNI can > work properly).
Yes, I'm aware of the attachment requirement. I'm curious how the code can get past the calls to GetStaticMethodID and FindClass if JNIEnv is NULL? Which made me wonder whether WTF::GetJavaEnv(); was actually passing the (thread-local) JNIEnv between threads, so I looked for that. Which I think is here? https://github.com/openjdk/jfx/blob/master/modules/javafx.web/src/main/native/Source/WTF/wtf/java/JavaEnv.h#L40 But that just seems to call through to GetEnv, and therefore should be returning NULL if the thread isn't attached? Like I said, been a while since I've worked with this much, but to me that stack trace suggests the thread, by getting to that point, is attached correctly. As an aside, someone had the right idea when they named all this! :-) Best wishes, Neil --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org For additional commands, e-mail: dev-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists