I have a number of c++ functions that are called by the native method (i.e. the C++ function "JNI_CALL someClass_someMethod...") and have a large number of local refs created. So in each I have to call EnsureLocalCapacity and PushLocalFrame to make sure there's enough "space" for everything (can't call DeleteLocalRef because all the objects will be needed at the same time).
Since this EnsureLocal/PushLocal code (including error checks) is repeated in all these methods, I'd like to make a function that handles all that, e.g. ensureAndPush(int requiredCapacity). However, if I'm understanding it correctly, the calls will then only increase the local capacity within the "ensureCapacity" function and not in the functions that call it. Is this correct?
Thanks! [ April 08, 2008: Message edited by: Dan Bizman ]