Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2022.
[simgrid.git] / src / bindings / java / jmsg_process.cpp
index 88f3347..51acb0d 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java process instances.                         */
 
-/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2022. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -141,7 +141,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getProperty(JNIEnv *env,
     jxbt_throw_notbound(env, "process", jprocess);
     return nullptr;
   }
-  const char* name = env->GetStringUTFChars((jstring)jname, nullptr);
+  jstring_wrapper name(env, (jstring)jname);
 
   const char* property = actor->get_property(name);
   if (not property)
@@ -149,8 +149,6 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_getProperty(JNIEnv *env,
 
   jobject jproperty = env->NewStringUTF(property);
 
-  env->ReleaseStringUTFChars((jstring)jname, name);
-
   return jproperty;
 }