| | |
| | | { |
| | | |
| | | PyGILThreadLock lock; |
| | | PyObject* pModule = create_py_module("${pyModule}.${pyName}"); |
| | | |
| | | jclass hashmapClass = env->FindClass("java/util/HashMap"); |
| | | 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); |
| | | cout << strValue << endl; |
| | | |
| | | PyObject* pModule = create_py_module(strValue); |
| | | /*PyObject* pModule = create_py_module("${pyModule}.${pyName}");*/ |
| | | if (pModule == NULL) |
| | | { |
| | | cout << "model error" << endl; |
| | |
| | | cout << "ConvertPydictToJhmap error" << endl; |
| | | throw "函数返回值异常!"; |
| | | } |
| | | delete pModule; |
| | | /*delete pModule; |
| | | pModule = nullptr; |
| | | delete pModule; |
| | | |
| | |
| | | pArg = nullptr; |
| | | delete pArg; |
| | | |
| | | Py_DECREF(pReturn); |
| | | Py_DECREF(pFunc); |
| | | Py_DECREF(pModule); |
| | | Py_CLEAR(pModule);*/ |
| | | |
| | | return result; |
| | | } |
| | | catch (const char* msg) |