dengzedong
2 天以前 074eb5598ca71283122392a8d71c6bff08326672
c++释放python资源
已修改1个文件
36 ■■■■ 文件已修改
iailab-module-model/iailab-module-model-biz/src/main/resources/template/cpp.vm 36 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
iailab-module-model/iailab-module-model-biz/src/main/resources/template/cpp.vm
@@ -94,39 +94,17 @@
            cout << "ConvertPydictToJhmap error" << endl;
            throw "函数返回值异常!";
        }
        /*delete pModule;
        pModule = nullptr;
        delete pModule;
        delete pFunc;
        pFunc = nullptr;
        delete pFunc;
        cout << "clear_py_memory" << endl;
        Py_XDECREF(pFunc);
#{foreach} ($column in [1..$entity.dataLength])
        delete[] data_${column};
        data_${column} = nullptr;
        delete data_${column};
        Py_XDECREF(data_${column});
#{end}
#{if}($entity.model==1)
        delete model_path;
        model_path = nullptr;
        delete model_path;
        Py_XDECREF(model_path);
#{end}
        delete settings_1;
        settings_1 = nullptr;
        delete settings_1;
        delete[] pArg;
        pArg = nullptr;
        delete pArg;
        Py_DECREF(pReturn);
        Py_DECREF(pFunc);
        Py_DECREF(pModule);
        Py_CLEAR(pModule);*/
        Py_XDECREF(settings_1);
        Py_XDECREF(pArg);
        Py_XDECREF(pReturn);
        return result;
    }
    catch (const char* msg)