diff --git a/util/RTCContext.cpp b/util/RTCContext.cpp index 31d5972..4620f11 100644 --- a/util/RTCContext.cpp +++ b/util/RTCContext.cpp @@ -355,17 +355,14 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId, throw std::runtime_error("Python callback error"); } std::cout << " 回调执行成功" << std::endl; - } - catch (const py::error_already_set& e) { - std::cerr << "[PYTHON ERROR] " << e.what() << std::endl; - PyErr_Print(); + + } catch (...) { + std::cout << "[ERROR] 回调执行失败" << std::endl; + munmap(ptr, data_size); + close(fd); + shm_unlink(shm_name); throw; } - catch (...) { - Py_DECREF(pyCallback_.ptr()); - throw; - } - Py_DECREF(pyCallback_.ptr()); } else { std::cout << "[7] 无回调函数设置" << std::endl; }