Browse files

move call to Classpath::shutDown

We must be in the Active state, not the Exclusive state when calling
this method since it may execute arbitrary Java code.  This fixes an
assertion failure in makeNew.
  • Loading branch information...
1 parent 8995db6 commit dfdd1f6e6c55ada96172f40d1256dc219637c492 @dicej dicej committed Apr 22, 2013
Showing with 5 additions and 2 deletions.
  1. +5 −0 src/jnienv.cpp
  2. +0 −2 src/machine.cpp
View
5 src/jnienv.cpp
@@ -74,6 +74,11 @@ DetachCurrentThread(Machine* m)
uint64_t
destroyJavaVM(Thread* t, uintptr_t*)
{
+ { ENTER(t, Thread::ActiveState);
+
+ t->m->classpath->shutDown(t);
+ }
+
// wait for other non-daemon threads to exit
{ ACQUIRE(t, t->m->stateLock);
while (t->m->liveCount - t->m->daemonCount > 1) {
View
2 src/machine.cpp
@@ -3324,8 +3324,6 @@ shutDown(Thread* t)
setRoot(t, Machine::ShutdownHooks, 0);
- t->m->classpath->shutDown(t);
-
object h = hooks;
PROTECT(t, h);
for (; h; h = pairSecond(t, h)) {

0 comments on commit dfdd1f6

Please sign in to comment.