Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DvDevice setDisabled doesn't work in Java
09-12-2011, 12:59 PM
Post: #3
RE: DvDevice setDisabled doesn't work in Java
(09-12-2011 11:46 AM)simonc Wrote:  Thanks for this. I've applied your suggested fix locally so it'll hopefully be on github this evening.

Thanks. I discovered another problem in the same area. In lines 45-49 of DvDevice.c, the call to DeleteGlobalRef() is made after the call to DetachCurrentThread(). This doesn't work, because the JVM doesn't allow a DeleteGlobalRef() call from a thread that isn't currently attached. The fix is to switch the order of these calls, as follows:

(*env)->CallVoidMethod(env, ref->callbackObj, mid);

(*env)->DeleteGlobalRef(env, ref->callbackObj);
if(attached < 0)
{
(*(ref->vm))->DetachCurrentThread(ref->vm);
}
free(ref);
Find all posts by this user


Messages In This Thread
RE: DvDevice setDisabled doesn't work in Java - simoncn - 09-12-2011 12:59 PM

Forum Jump: