title: Should I call PushLocalFrame and PopLocalFrame when I call Java Method From C++?
body: <p>Question 1:
  I have a java class with a static method:</p>
  
  <pre><code>class Test {
      static public void show (String value) {
          // dosomething with value 
      }
  }
  </code></pre>
  
  <p>If I want call it from c++:</p>
  
  <pre><code>jstring value = env-&gt;NewStringUTF("Hello, World");
  // ExceptionCheck after NewStringUTF.
  env-&gt;CallStaticVoidMethod(the_jclass, the_jmethodID, value);
  // ExceptionCheck after CallStaticVoidMethod.
  </code></pre>
  
  <p>Should I put <strong>PushLocalFrame</strong> before <strong>NewStringUTF</strong> and put <strong>PopLocalFrame</strong> after <strong>CallStaticVoidMethod</strong> to release local references?</p>
  
  <p>Question 2:</p>
  
  <p>I see the declaration of <strong>PopLocalFrame</strong>, it's:</p>
  
  <pre><code>jobject PopLocalFrame(JNIEnv *env, jobject result);
  </code></pre>
  
  <p>After reading the jni documents, I still can't understand why PopLocalFrame needs a <strong>result parameter</strong> and a <strong>return value</strong>. Could you give me a example to show it's existence value?</p>