diff --git a/util/RTCContext.cpp b/util/RTCContext.cpp index d768c28..4e3b6bd 100644 --- a/util/RTCContext.cpp +++ b/util/RTCContext.cpp @@ -63,12 +63,6 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId, { namespace py = boost::python; - // 1. 获取 GIL(绝对必要) - if (!Py_IsInitialized()) { - std::cerr << "Python interpreter not initialized" << std::endl; - return; - } - boost::python::gil_scoped_acquire gil; PyGILState_STATE gstate = PyGILState_Ensure(); try { @@ -99,7 +93,6 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId, // 5. 创建NumPy数组(带内存保护) PyObject* pyArray = nullptr; { - py::gil_scoped_acquire gil; // 确保在创建数组时持有GIL pyArray = PyArray_SimpleNew(1, dims, NPY_INT16); if (!pyArray) { PyGILState_Release(gstate);