mirror of https://github.com/labapart/gattlib
common/gattlib_common: Release Python PyObject
parent
d9c18b93a3
commit
2570850046
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0-or-later
|
||||
*
|
||||
* Copyright (c) 2021, Olivier Martin <olivier@labapart.org>
|
||||
* Copyright (c) 2021-2022, Olivier Martin <olivier@labapart.org>
|
||||
*/
|
||||
|
||||
#if defined(WITH_PYTHON)
|
||||
|
@ -75,6 +75,7 @@ void gattlib_call_notification_handler(struct gattlib_handler *handler, const uu
|
|||
}
|
||||
PyObject *arglist = Py_BuildValue(argument_string, uuid_str, data, data_length, handler->user_data);
|
||||
PyEval_CallObject((PyObject *)handler->notification_handler, arglist);
|
||||
Py_DECREF(arglist);
|
||||
|
||||
PyGILState_Release(d_gstate);
|
||||
}
|
||||
|
@ -95,6 +96,7 @@ void gattlib_call_disconnection_handler(struct gattlib_handler *handler) {
|
|||
|
||||
PyObject *arglist = Py_BuildValue("(O)", handler->user_data);
|
||||
PyEval_CallObject((PyObject *)handler->disconnection_handler, arglist);
|
||||
Py_DECREF(arglist);
|
||||
|
||||
PyGILState_Release(d_gstate);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue