diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-04-24 16:31:07 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-04-24 16:37:32 +0300 |
commit | 0f1ee611d4499fbac050b7a997e50bc234a252f9 (patch) | |
tree | 0cea65bf1f560715857a784d24ba1839cfde1167 /source/blender/windowmanager/gizmo/WM_gizmo_api.h | |
parent | aa95f8019e4204ea50210add1b2c2ed1934b92c9 (diff) |
Fix T85567: Crash accessing gizmo group on `__del__`
- Re-order freeing so an instances __del__ method runs before the
`ExtensionRNA` has been freed.
- "remove" functions no longer free the gizmo/gizmo-group memory,
needed so the identifier used when freeing the extension
doesn't use the freed identifier.
Diffstat (limited to 'source/blender/windowmanager/gizmo/WM_gizmo_api.h')
-rw-r--r-- | source/blender/windowmanager/gizmo/WM_gizmo_api.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/windowmanager/gizmo/WM_gizmo_api.h b/source/blender/windowmanager/gizmo/WM_gizmo_api.h index cf1a7628267..c7a4b064d0e 100644 --- a/source/blender/windowmanager/gizmo/WM_gizmo_api.h +++ b/source/blender/windowmanager/gizmo/WM_gizmo_api.h @@ -146,6 +146,7 @@ void WM_gizmotype_append(void (*gtfunc)(struct wmGizmoType *)); void WM_gizmotype_append_ptr(void (*gtfunc)(struct wmGizmoType *, void *), void *userdata); bool WM_gizmotype_remove(struct bContext *C, struct Main *bmain, const char *idname); void WM_gizmotype_remove_ptr(struct bContext *C, struct Main *bmain, struct wmGizmoType *gzt); +void WM_gizmotype_free_ptr(struct wmGizmoType *gzt); void WM_gizmotype_iter(struct GHashIterator *ghi); /* wm_gizmo_group_type.c */ @@ -154,8 +155,6 @@ struct wmGizmoGroupType *WM_gizmogrouptype_append(void (*wtfunc)(struct wmGizmoG struct wmGizmoGroupType *WM_gizmogrouptype_append_ptr(void (*wtfunc)(struct wmGizmoGroupType *, void *), void *userdata); -bool WM_gizmogrouptype_free(const char *idname); -void WM_gizmogrouptype_free_ptr(struct wmGizmoGroupType *gzgt); void WM_gizmogrouptype_iter(struct GHashIterator *ghi); struct wmGizmoGroupTypeRef *WM_gizmogrouptype_append_and_link( @@ -378,6 +377,9 @@ void WM_gizmo_group_unlink_delayed_ptr_from_space(struct wmGizmoGroupType *gzgt, struct wmGizmoMapType *gzmap_type, struct ScrArea *area); +void WM_gizmo_group_type_free_ptr(wmGizmoGroupType *gzgt); +bool WM_gizmo_group_type_free(const char *idname); + /* Has the result of unlinking and linking (re-initializes gizmo's). */ void WM_gizmo_group_type_reinit_ptr_ex(struct Main *bmain, struct wmGizmoGroupType *gzgt, |