File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -173,18 +173,19 @@ void WallClockJVMTI::timerLoop() {
173173
174174 bool do_filter = Profiler::instance ()->threadFilter ()->enabled ();
175175 int self = OS::threadId ();
176+ JNIEnv *env = VM::jni ();
176177
177178 for (int i = 0 ; i < threads_count; i++) {
178179 jthread thread = threads_ptr[i];
179180 if (thread != nullptr ) {
180181 ddprof::VMThread* nThread = static_cast <ddprof::VMThread*>(VMThread::fromJavaThread (jni, thread));
181- if (nThread == nullptr ) {
182- continue ;
183- }
184- int tid = nThread->osThreadId ();
185- if (tid != self && (!do_filter || Profiler::instance ()->threadFilter ()->accept (tid))) {
186- threads.push_back ({nThread, thread});
182+ if (nThread != nullptr ) {
183+ int tid = nThread->osThreadId ();
184+ if (tid != self && (!do_filter || Profiler::instance ()->threadFilter ()->accept (tid))) {
185+ threads.push_back ({nThread, thread});
186+ }
187187 }
188+ env->DeleteLocalRef (thread);
188189 }
189190 }
190191 jvmti->Deallocate ((unsigned char *)threads_ptr);
You can’t perform that action at this time.
0 commit comments