You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2011/05/18 19:19:44 UTC
svn commit: r1124341 -
/commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c
Author: mturk
Date: Wed May 18 17:19:43 2011
New Revision: 1124341
URL: http://svn.apache.org/viewvc?rev=1124341&view=rev
Log:
Make sure the instance object is global referenced
Modified:
commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c
Modified: commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c?rev=1124341&r1=1124340&r2=1124341&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/unsafe.c Wed May 18 17:19:43 2011
@@ -93,7 +93,9 @@ ACR_INLINE(jobject)
_get_unsafe(JNI_STDENV)
{
if (_unsafe_instance == 0 && CLAZZ_LOADED) {
- _unsafe_instance = GET_SFIELD_O(0000, _clazzn.i);
+ jobject u = GET_SFIELD_O(0000, _clazzn.i);
+ if (u != 0)
+ _unsafe_instance = (*env)->NewGlobalRef(env, u);
/* Clear exception if any.
*/
(*env)->ExceptionClear(env);