Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/intern/bpy_rna_gizmo.c
| Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | static void py_rna_gizmo_handler_get_cb(const wmGizmo *UNUSED(gz), | ||||
| PyGILState_Release(gilstate); | PyGILState_Release(gilstate); | ||||
| return; | return; | ||||
| fail: | fail: | ||||
| PyErr_Print(); | PyErr_Print(); | ||||
| PyErr_Clear(); | PyErr_Clear(); | ||||
| Py_DECREF(ret); | |||||
| PyGILState_Release(gilstate); | PyGILState_Release(gilstate); | ||||
| } | } | ||||
| static void py_rna_gizmo_handler_set_cb(const wmGizmo *UNUSED(gz), | static void py_rna_gizmo_handler_set_cb(const wmGizmo *UNUSED(gz), | ||||
| wmGizmoProperty *gz_prop, | wmGizmoProperty *gz_prop, | ||||
| const void *value_p) | const void *value_p) | ||||
| { | { | ||||
| const PyGILState_STATE gilstate = PyGILState_Ensure(); | const PyGILState_STATE gilstate = PyGILState_Ensure(); | ||||
| Show All 20 Lines | else { | ||||
| PyErr_SetString(PyExc_AttributeError, "internal error, unsupported type"); | PyErr_SetString(PyExc_AttributeError, "internal error, unsupported type"); | ||||
| goto fail; | goto fail; | ||||
| } | } | ||||
| PyObject *ret = PyObject_CallObject(data->fn_slots[BPY_GIZMO_FN_SLOT_SET], args); | PyObject *ret = PyObject_CallObject(data->fn_slots[BPY_GIZMO_FN_SLOT_SET], args); | ||||
| if (ret == NULL) { | if (ret == NULL) { | ||||
| goto fail; | goto fail; | ||||
| } | } | ||||
| Py_DECREF(args); | |||||
| Py_DECREF(ret); | Py_DECREF(ret); | ||||
| PyGILState_Release(gilstate); | PyGILState_Release(gilstate); | ||||
| return; | return; | ||||
| fail: | fail: | ||||
| PyErr_Print(); | PyErr_Print(); | ||||
| PyErr_Clear(); | PyErr_Clear(); | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | else { | ||||
| goto fail; | goto fail; | ||||
| } | } | ||||
| Py_DECREF(ret); | Py_DECREF(ret); | ||||
| PyGILState_Release(gilstate); | PyGILState_Release(gilstate); | ||||
| return; | return; | ||||
| fail: | fail: | ||||
| Py_XDECREF(ret); | |||||
| PyErr_Print(); | PyErr_Print(); | ||||
| PyErr_Clear(); | PyErr_Clear(); | ||||
| Py_XDECREF(ret); | |||||
| PyGILState_Release(gilstate); | PyGILState_Release(gilstate); | ||||
| } | } | ||||
| static void py_rna_gizmo_handler_free_cb(const wmGizmo *UNUSED(gz), wmGizmoProperty *gz_prop) | static void py_rna_gizmo_handler_free_cb(const wmGizmo *UNUSED(gz), wmGizmoProperty *gz_prop) | ||||
| { | { | ||||
| struct BPyGizmoHandlerUserData *data = gz_prop->custom_func.user_data; | struct BPyGizmoHandlerUserData *data = gz_prop->custom_func.user_data; | ||||
| const PyGILState_STATE gilstate = PyGILState_Ensure(); | const PyGILState_STATE gilstate = PyGILState_Ensure(); | ||||
| ▲ Show 20 Lines • Show All 331 Lines • Show Last 20 Lines | |||||