I don't think so, according to the documentation the 3rd parameter tells the GetString function whether to make a copy or not. And the __atoe does an inplace xlate so its not making any copies either. I think we are just getting lucky that the garbage collection is not getting run until after the copy has been made by strcpy. Its a short code path to that, so it is probably possible. But right out of the documentation it says
"Note that when your native code is finished using the UTF-8 string, it must call ReleaseStringUTFChars. ReleaseStringUTFChars informs the VM that the native method is finished with the string, so that the memory taken by the UTF-8 string can then be freed. Failing to call ReleaseStringUTFChars results in a memory leak. This will ultimately lead to system memory exhaustion." It is not going to affect the code if I move the Release to after the strcpy, but I just wanted to get some confirmation that this is the way it should be. Thanks ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
