src/hotspot/share/prims/jni.cpp
changeset 48105 8d15b1369c7a
parent 47998 fb0275c320a0
child 48558 b2b67c8fc91a
child 48787 7638bf98a312
--- a/src/hotspot/share/prims/jni.cpp	Wed Nov 22 14:31:48 2017 -0500
+++ b/src/hotspot/share/prims/jni.cpp	Wed Nov 22 17:54:50 2017 -0800
@@ -4119,7 +4119,7 @@
   thread->initialize_thread_current();
 
   if (!os::create_attached_thread(thread)) {
-    delete thread;
+    thread->smr_delete();
     return JNI_ERR;
   }
   // Enable stack overflow checks
@@ -4250,7 +4250,7 @@
   // (platform-dependent) methods where we do alternate stack
   // maintenance work?)
   thread->exit(false, JavaThread::jni_detach);
-  delete thread;
+  thread->smr_delete();
 
   HOTSPOT_JNI_DETACHCURRENTTHREAD_RETURN(JNI_OK);
   return JNI_OK;