X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/22e875c804fc69d71ceac52df5573300482113ee..fc9db1be8c886672e63a1589a5a2b8e9a9561818:/src/bindings/java/jmsg.cpp diff --git a/src/bindings/java/jmsg.cpp b/src/bindings/java/jmsg.cpp index 3b06e2e57b..80618e0c8c 100644 --- a/src/bindings/java/jmsg.cpp +++ b/src/bindings/java/jmsg.cpp @@ -142,14 +142,14 @@ JNIEXPORT void JNICALL JNICALL Java_org_simgrid_msg_Msg_run(JNIEnv* env, jclass) XBT_INFO("MSG_main finished; Terminating the simulation..."); /* Cleanup java hosts */ - xbt_dynar_t hosts = MSG_hosts_as_dynar(); - for (unsigned long index = 0; index < xbt_dynar_length(hosts) - 1; index++) { - auto const* msg_host = xbt_dynar_get_as(hosts, index, msg_host_t); - jobject jhost = (jobject) msg_host->extension(JAVA_HOST_LEVEL); + sg_host_t* hosts = sg_host_list(); + size_t host_count = sg_host_count(); + for (size_t index = 0; index < host_count - 1; index++) { + jobject jhost = (jobject)hosts[index]->extension(JAVA_HOST_LEVEL); if (jhost) jhost_unref(env, jhost); } - xbt_dynar_free(&hosts); + xbt_free(hosts); /* Cleanup java storages */ for (auto const& elm : java_storage_map)