| | |
| | | jmethodID getMID = env->GetMethodID(hashmapClass, "get", "(Ljava/lang/Object;)Ljava/lang/Object;"); |
| | | jstring keyJString = env->NewStringUTF("pyFile"); |
| | | jobject javaValueObj = env->CallObjectMethod(settings, getMID, keyJString); |
| | | const char* strValue = env->GetStringUTFChars((jstring)javaValueObj, NULL); |
| | | |
| | | jstring javaStringValue = (jstring)javaValueObj; |
| | | const char* strValue = env->GetStringUTFChars(javaStringValue, NULL); |
| | | //*************导入模型****************** |
| | | PyObject* pModule = create_py_module(strValue); |
| | | /*PyObject* pModule = create_py_module("${pyModule}.${pyName}");*/ |
| | | // 释放java占用内存 |
| | | env->ReleaseStringUTFChars(javaStringValue, strValue); |
| | | env->DeleteLocalRef(javaStringValue); |
| | | env->DeleteLocalRef(javaValueObj); |
| | | env->DeleteLocalRef(keyJString); |
| | | env->DeleteLocalRef(hashmapClass); |
| | | if (pModule == NULL) |
| | | { |
| | | cout << "model error" << endl; |