X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3a1ea70a418f393ca1677074e928c664022295bd..67d66b0cf79b9fc02c0450f254584693dbf21d3b:/src/bindings/java/jmsg_as.cpp diff --git a/src/bindings/java/jmsg_as.cpp b/src/bindings/java/jmsg_as.cpp index b87a5e9472..b040fd9efe 100644 --- a/src/bindings/java/jmsg_as.cpp +++ b/src/bindings/java/jmsg_as.cpp @@ -1,6 +1,6 @@ /* Java bindings of the NetZones. */ -/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2021. 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. */ @@ -102,7 +102,7 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnv *env, jobje jxbt_throw_notbound(env, "as", jas); return nullptr; } - const char* name = env->GetStringUTFChars(static_cast(jname), nullptr); + jstring_wrapper name(env, static_cast(jname)); const char* property = sg_zone_get_property_value(as, name); if (not property) { @@ -111,8 +111,6 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_As_getProperty(JNIEnv *env, jobje jobject jproperty = env->NewStringUTF(property); - env->ReleaseStringUTFChars(static_cast(jname), name); - return jproperty; }