Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ndicapimodule.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -752,11 +752,20 @@ static PyObject* Py_ndiCommand(PyObject* module, PyObject* args)
return NULL;
}

result = ndiCommand(pol, "%s", PyString_AsString(newstring));
const char* cmd_cstr = PyString_AsString(newstring);
// Assumes caller manages threads.
Py_BEGIN_ALLOW_THREADS
result = ndiCommand(pol, "%s", cmd_cstr);
Py_END_ALLOW_THREADS
}
else
{
Py_DECREF(initial);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, not my expertise, but why are these two reference decreases repeated? Is this a separate bug being fixed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to be honest and say it was suggested by AI as a separate bug, so I left it in there. I don't really know how to test it in a reasonable time frame? Is there a simple test harness, where we could output the ref count while tracking?

Py_DECREF(remainder);
// Assumes caller manages threads.
Py_BEGIN_ALLOW_THREADS
result = ndiCommand(pol, NULL);
Py_END_ALLOW_THREADS
}

if (newstring != NULL)
Expand Down