debug
This commit is contained in:
parent
1ca1cc77cc
commit
e7b19b4e9a
|
@ -63,12 +63,6 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
|
||||||
{
|
{
|
||||||
namespace py = boost::python;
|
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();
|
PyGILState_STATE gstate = PyGILState_Ensure();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -99,7 +93,6 @@ void RTCContext::onAudioProcess(const char* roomId, const char* peerId,
|
||||||
// 5. 创建NumPy数组(带内存保护)
|
// 5. 创建NumPy数组(带内存保护)
|
||||||
PyObject* pyArray = nullptr;
|
PyObject* pyArray = nullptr;
|
||||||
{
|
{
|
||||||
py::gil_scoped_acquire gil; // 确保在创建数组时持有GIL
|
|
||||||
pyArray = PyArray_SimpleNew(1, dims, NPY_INT16);
|
pyArray = PyArray_SimpleNew(1, dims, NPY_INT16);
|
||||||
if (!pyArray) {
|
if (!pyArray) {
|
||||||
PyGILState_Release(gstate);
|
PyGILState_Release(gstate);
|
||||||
|
|
Loading…
Reference in New Issue