[Bf-blender-cvs] [aa49444c291] master: Fix crash when deleting workspaces too fast

Dalai Felinto noreply at git.blender.org
Fri Mar 8 22:54:53 CET 2019


Commit: aa49444c291fd54e5e45576a28d36d72816a5469
Author: Dalai Felinto
Date:   Fri Mar 8 17:58:20 2019 -0300
Branches: master
https://developer.blender.org/rBaa49444c291fd54e5e45576a28d36d72816a5469

Fix crash when deleting workspaces too fast

Delete workspaces via the menu was not refreshing the workspace tabs
drawing. This way if you deleted the non-active workspace  with the "e" shortcut
from the workspace tab context menu and clicked on the workspace tabs again, it
would crash.

A few notes:
* Deleting a non-active workspace is changing which workspace is then active,
  which is really strange.

* Even when deleting the active workspace which workspace then becomes active
  seems random.

* Using notifiers (ND_WORKSPACE_DELETE) to delete the workspace seems rather
abusing notifiers in my humble opinion.

This is not an important bugfix anyways, people probably would rarely
run into this. I just ran into it while investigating another bug.

===================================================================

M	source/blender/editors/screen/workspace_edit.c

===================================================================

diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c
index b442f718aa1..b63a755368e 100644
--- a/source/blender/editors/screen/workspace_edit.c
+++ b/source/blender/editors/screen/workspace_edit.c
@@ -301,6 +301,7 @@ static int workspace_delete_exec(bContext *C, wmOperator *UNUSED(op))
 {
 	WorkSpace *workspace = workspace_context_get(C);
 	WM_event_add_notifier(C, NC_SCREEN | ND_WORKSPACE_DELETE, workspace);
+	WM_event_add_notifier(C, NC_WINDOW, NULL);
 
 	return OPERATOR_FINISHED;
 }



More information about the Bf-blender-cvs mailing list