title: Must I DeleteLocalRef an object I have called NewGlobalRef on?
body: <p>As we know, creating Java objects in a thread owned by C/C++ we are responsible to call <code>DeleteLocalRef</code> or <code>Push/Pop LocalFrame</code> as needed.</p>
  
  <p>I have some code like </p>
  
  <pre><code>jbyteArray buffer = env-&gt;NewByteArray((jsize)requiredSize);
  longTermBufferReference = (jbyteArray)env-&gt;NewGlobalRef(buffer);
  </code></pre>
  
  <p>where native code creates a byte array, which it re-uses across multiple threads/calls, once we are done with it, I call <code>DeleteGlobalRef</code> on the buffer.</p>
  
  <p>The question is, must I call DeleteLocalRef on <code>buffer</code> when I'm done, or does the GlobalRef take complete ownership of the object?</p>