fix off-by-one error that probably had me slowly leaking local obj

references for the last few years.
This commit is contained in:
Eric House 2015-08-02 16:29:53 -07:00
parent 56082d2f7b
commit b3ca4ee223
2 changed files with 3 additions and 3 deletions

View file

@ -687,10 +687,10 @@ void deleteLocalRef( JNIEnv* env, jobject jobj )
}
void
deleteLocalRefs( JNIEnv* env, jobject jobj, ... )
deleteLocalRefs( JNIEnv* env, ... )
{
va_list ap;
va_start( ap, jobj );
va_start( ap, env );
for ( ; ; ) {
jobject jnext = va_arg( ap, jobject );
if ( DELETE_NO_REF == jnext ) {

View file

@ -101,6 +101,6 @@ jint jEnumToInt( JNIEnv* env, jobject jenum );
XP_U32 getCurSeconds( JNIEnv* env );
void deleteLocalRef( JNIEnv* env, jobject jobj );
void deleteLocalRefs( JNIEnv* env, jobject jobj, ... );
void deleteLocalRefs( JNIEnv* env, ... );
# define DELETE_NO_REF ((jobject)-1) /* terminates above varargs list */
#endif