diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-13 23:18:11 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-13 23:20:49 +0300 |
commit | e2fdbf75990f8baf8676ad7cf71e6176a82efbf1 (patch) | |
tree | 19fb365b7d87b9d7bdf2ce31d175a3ab7c04f604 /source | |
parent | 164fafdcb01a505a382cb16a38d07a9d53586764 (diff) |
Fix T64407: crash adding workspace after appending datablock
The files operator property should not be remembered for next
operator executions, gives unexpected effects when using the
operator again.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/screen/workspace_edit.c | 12 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operator_props.c | 4 |
2 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c index 2dfa05cf6b0..863e3a15120 100644 --- a/source/blender/editors/screen/workspace_edit.c +++ b/source/blender/editors/screen/workspace_edit.c @@ -373,13 +373,15 @@ static int workspace_append_activate_exec(bContext *C, wmOperator *op) &bmain->workspaces, idname, offsetof(ID, name) + 2); BLI_assert(appended_workspace != NULL); - /* Reorder to last position. */ - BKE_id_reorder(&bmain->workspaces, &appended_workspace->id, NULL, true); + if (appended_workspace) { + /* Reorder to last position. */ + BKE_id_reorder(&bmain->workspaces, &appended_workspace->id, NULL, true); - /* Changing workspace changes context. Do delayed! */ - WM_event_add_notifier(C, NC_SCREEN | ND_WORKSPACE_SET, appended_workspace); + /* Changing workspace changes context. Do delayed! */ + WM_event_add_notifier(C, NC_SCREEN | ND_WORKSPACE_SET, appended_workspace); - return OPERATOR_FINISHED; + return OPERATOR_FINISHED; + } } return OPERATOR_CANCELLED; diff --git a/source/blender/windowmanager/intern/wm_operator_props.c b/source/blender/windowmanager/intern/wm_operator_props.c index db1f9a32935..3ad7247d993 100644 --- a/source/blender/windowmanager/intern/wm_operator_props.c +++ b/source/blender/windowmanager/intern/wm_operator_props.c @@ -94,7 +94,9 @@ void WM_operator_properties_filesel(wmOperatorType *ot, } if (flag & WM_FILESEL_FILES) { - RNA_def_collection_runtime(ot->srna, "files", &RNA_OperatorFileListElement, "Files", ""); + prop = RNA_def_collection_runtime( + ot->srna, "files", &RNA_OperatorFileListElement, "Files", ""); + RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE); } if (action == FILE_SAVE) { |