NewStringUTF() and freeing memory

前端 未结 2 1581
你的背包
你的背包 2020-12-08 13:30

Should I free the allocated string after passing it to NewStringUTF()?

I have some code similar to:



        
2条回答
  •  执笔经年
    2020-12-08 13:58

    You just need DeleteLocalRef(), NewStringUTF() is just malloc memory on JVM, which the JVM will take care of the memory.

提交回复
热议问题