Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/workspace.c')
-rw-r--r--source/blender/blenkernel/intern/workspace.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c
index dd2b182474e..3e449fa6b25 100644
--- a/source/blender/blenkernel/intern/workspace.c
+++ b/source/blender/blenkernel/intern/workspace.c
@@ -26,6 +26,7 @@
#include "BLI_string_utils.h"
#include "BLI_listbase.h"
+#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_library.h"
#include "BKE_main.h"
@@ -202,8 +203,10 @@ WorkSpaceInstanceHook *BKE_workspace_instance_hook_create(const Main *bmain)
}
void BKE_workspace_instance_hook_free(const Main *bmain, WorkSpaceInstanceHook *hook)
{
- /* workspaces should never be freed before wm (during which we call this function) */
- BLI_assert(!BLI_listbase_is_empty(&bmain->workspaces));
+ /* workspaces should never be freed before wm (during which we call this function).
+ * However, when running in background mode, loading a blend file may allocate windows (that need
+ * to be freed) without creating workspaces. This happens in BlendfileLoadingBaseTest. */
+ BLI_assert(!BLI_listbase_is_empty(&bmain->workspaces) || G.background);
/* Free relations for this hook */
for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) {