diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-06-15 05:50:08 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-06-15 05:52:59 +0300 |
commit | 2ba804d7b7dc9612540ff0d15a89cc1fc8c0bffa (patch) | |
tree | 6d2aaf2ec1d0fd43010ba7bead88914a8bd935ca /source/blender/editors | |
parent | 5dc0fd08a70b123e5d17057e1cbc1462bef0d8d8 (diff) |
Screen: clear runtime structures on file-read & data-copy
Clear the runtime data structs instead of individual members,
this simplifies adding new runtime members as there are at least
two places they would need to be cleared.
Resolves error in D8883.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/space_action/space_action.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_graph/space_graph.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 7 |
3 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index f6af2f79890..26b087168f9 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -153,6 +153,8 @@ static SpaceLink *action_duplicate(SpaceLink *sl) { SpaceAction *sactionn = MEM_dupallocN(sl); + memset(&sactionn->runtime, 0x0, sizeof(sactionn->runtime)); + /* clear or remove stuff from old */ return (SpaceLink *)sactionn; diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 9f01773eadf..0c6d904de01 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -172,6 +172,8 @@ static SpaceLink *graph_duplicate(SpaceLink *sl) { SpaceGraph *sipon = MEM_dupallocN(sl); + memset(&sipon->runtime, 0x0, sizeof(sipon->runtime)); + /* clear or remove stuff from old */ BLI_duplicatelist(&sipon->runtime.ghost_curves, &((SpaceGraph *)sl)->runtime.ghost_curves); sipon->ads = MEM_dupallocN(sipon->ads); diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 001def7318e..36901141497 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -351,14 +351,13 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl) View3D *v3do = (View3D *)sl; View3D *v3dn = MEM_dupallocN(sl); + memset(&v3dn->runtime, 0x0, sizeof(v3dn->runtime)); + /* clear or remove stuff from old */ if (v3dn->localvd) { v3dn->localvd = NULL; - v3dn->runtime.properties_storage = NULL; } - /* Only one View3D is allowed to have this flag! */ - v3dn->runtime.flag &= ~V3D_RUNTIME_XR_SESSION_ROOT; v3dn->local_collections_uuid = 0; v3dn->flag &= ~(V3D_LOCAL_COLLECTIONS | V3D_XR_SESSION_MIRROR); @@ -373,8 +372,6 @@ static SpaceLink *view3d_duplicate(SpaceLink *sl) /* copy or clear inside new stuff */ - v3dn->runtime.properties_storage = NULL; - return (SpaceLink *)v3dn; } |