Manipulator: add free callback
This commit is contained in:
parent
129196dc32
commit
7c1286b2b7
|
@ -313,6 +313,9 @@ typedef struct wmManipulatorType {
|
|||
/* called when manipulator selection state changes */
|
||||
wmManipulatorFnSelectRefresh select_refresh;
|
||||
|
||||
/* Free data (not the manipulator it's self), use when the manipulator allocates it's own members. */
|
||||
wmManipulatorFnFree free;
|
||||
|
||||
/* RNA for properties */
|
||||
struct StructRNA *srna;
|
||||
|
||||
|
|
|
@ -166,6 +166,10 @@ static void wm_manipulator_register(wmManipulatorGroup *mgroup, wmManipulator *m
|
|||
*/
|
||||
void WM_manipulator_free(wmManipulator *mpr)
|
||||
{
|
||||
if (mpr->type->free != NULL) {
|
||||
mpr->type->free(mpr);
|
||||
}
|
||||
|
||||
#ifdef WITH_PYTHON
|
||||
if (mpr->py_instance) {
|
||||
/* do this first in case there are any __del__ functions or
|
||||
|
|
|
@ -59,6 +59,7 @@ typedef int (*wmManipulatorFnInvoke)(struct bContext *, struct wmManipulator
|
|||
typedef void (*wmManipulatorFnExit)(struct bContext *, struct wmManipulator *, const bool);
|
||||
typedef int (*wmManipulatorFnCursorGet)(struct wmManipulator *);
|
||||
typedef void (*wmManipulatorFnSelectRefresh)(struct wmManipulator *);
|
||||
typedef void (*wmManipulatorFnFree)(struct wmManipulator *);
|
||||
|
||||
/* wmManipulatorProperty ('value' type defined by 'wmManipulatorProperty.data_type') */
|
||||
typedef void (*wmManipulatorPropertyFnGet)(
|
||||
|
|
Loading…
Reference in New Issue