* jni.cc (_Jv_JNI_NewLocalRef): Search other frames.
From-SVN: r43415
This commit is contained in:
parent
827a5be702
commit
a5c30a8cff
2 changed files with 19 additions and 8 deletions
|
@ -278,16 +278,23 @@ _Jv_JNI_NewLocalRef (JNIEnv *env, jobject obj)
|
|||
// Try to find an open slot somewhere in the topmost frame.
|
||||
_Jv_JNI_LocalFrame *frame = env->locals;
|
||||
bool done = false, set = false;
|
||||
while (frame != NULL && ! done)
|
||||
for (; frame != NULL && ! done; frame = frame->next)
|
||||
{
|
||||
for (int i = 0; i < frame->size; ++i)
|
||||
if (frame->vec[i] == NULL)
|
||||
{
|
||||
set = true;
|
||||
done = true;
|
||||
frame->vec[i] = obj;
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (frame->vec[i] == NULL)
|
||||
{
|
||||
set = true;
|
||||
done = true;
|
||||
frame->vec[i] = obj;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If we found a slot, or if the frame we just searched is the
|
||||
// mark frame, then we are done.
|
||||
if (done || frame->marker != MARK_NONE)
|
||||
break;
|
||||
}
|
||||
|
||||
if (! set)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue