mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-24 22:58:13 +00:00
Prevent crash in the Python wrapper when destroying the cores.
This commit is contained in:
parent
06cac462a7
commit
d2acdcdc1b
1 changed files with 2 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ static void pylinphone_log(const char *level, int indent, const char *fmt, va_li
|
|||
PyGILState_STATE gstate;
|
||||
|
||||
gstate = PyGILState_Ensure();
|
||||
if (gstate != PyGILState_LOCKED) return;
|
||||
linphone_module = PyImport_ImportModule("linphone.linphone");
|
||||
if ((linphone_module != NULL) && PyObject_HasAttrString(linphone_module, "__log_handler")) {
|
||||
PyObject *log_handler = PyObject_GetAttrString(linphone_module, "__log_handler");
|
||||
|
|
@ -71,6 +72,7 @@ static void pylinphone_module_log_handler(OrtpLogLevel lev, const char *fmt, va_
|
|||
const char *level;
|
||||
|
||||
gstate = PyGILState_Ensure();
|
||||
if (gstate != PyGILState_LOCKED) return;
|
||||
linphone_module = PyImport_ImportModule("linphone.linphone");
|
||||
level = pylinphone_ortp_log_level_to_string(lev);
|
||||
if ((linphone_module != NULL) && PyObject_HasAttrString(linphone_module, "__log_handler")) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue