From d9c0012c756acc7a9958c3e6bcfb391342a6e57c Mon Sep 17 00:00:00 2001 From: wangjiyu Date: Fri, 11 Apr 2025 09:13:06 +0800 Subject: [PATCH] debug --- util/RTCContext.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) 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; }