What is the rule when a C ++ program (!) Calls a java method that returns an object? Is there a wonderful link to this object? Should I call "DeleteLocalRef" to make sure the object is GCd, or will it be GCd automatically? The reason why this is not clear to me is that in all the examples and official documentation that indicate that “DeleteLocalRef” is not necessary, it only makes sense to me when the native C / C method runs in Java ++ ". But if the calling thread is a C ++ method calling java, how does the JVM know that the object can be GCd?
On the same lines: if I want to cache an object, should I call "NewGlobalRef"?
Could not find a link to this ...
Thanks for any link and / or clarification
source
share