This commit is contained in:
wangjiyu 2025-04-11 09:10:16 +08:00
parent 80ab364d59
commit 55124f0ddb
1 changed files with 9 additions and 6 deletions

View File

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