JniLocalRefReaper Class Reference

Guard for deleting a local ref automatically on unwind. More...

#include <JniUtil.h>

List of all members.

Public Member Functions

 JniLocalRefReaper (JniEnvRef &pEnvInit, jobject objInit)
 ~JniLocalRefReaper ()

Private Attributes

JNIEnv * pEnv
jobject obj

Detailed Description

Guard for deleting a local ref automatically on unwind.

Needed in places where temporary Java objects are needed inside of utility methods which may be called many times before control returns to Java.

Definition at line 145 of file JniUtil.h.

Constructor & Destructor Documentation

JniLocalRefReaper::JniLocalRefReaper ( JniEnvRef pEnvInit,
jobject  objInit 
) [inline]

Definition at line 151 of file JniUtil.h.

References JniEnvRef::get().

00152     {
00153         pEnv = pEnvInit.get();
00154         obj = objInit;
00155     }

JniLocalRefReaper::~JniLocalRefReaper (  )  [inline]

Definition at line 157 of file JniUtil.h.

00158     {
00159         if (obj) {
00160             pEnv->DeleteLocalRef(obj);
00161             obj = NULL;
00162         }
00163     }

Member Data Documentation

JNIEnv* JniLocalRefReaper::pEnv [private]

Definition at line 147 of file JniUtil.h.

jobject JniLocalRefReaper::obj [private]

Definition at line 148 of file JniUtil.h.

The documentation for this class was generated from the following file:
Generated on Mon Jun 22 04:00:33 2009 for Fennel by  doxygen 1.5.1