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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-06-05 18:51:17 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-05 18:54:53 +0300
commit1628a6858e22d5e49798f84576283debc5cf2819 (patch)
treee9d9d31b90e298ddc8bc84b548be0a177047d3f9
parent481cdb08ed6f33a09d0e6843d1024db93c301178 (diff)
Fix crash in owmn previous commit.
-rw-r--r--source/blender/windowmanager/intern/wm_files.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 66080e3722f..ffc6a566ced 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -656,7 +656,7 @@ int wm_homefile_read(
bool use_factory_settings, bool use_empty_data, bool use_userdef,
const char *filepath_startup_override, const char *app_template_override)
{
- Main *bmain = CTX_data_main(C);
+ Main *bmain = G.main; /* Context does not always have valid main pointer here... */
ListBase wmbase;
bool success = false;
@@ -848,9 +848,11 @@ int wm_homefile_read(
* can remove this eventually, only in a 2.53 and older, now its not written */
G.fileflags &= ~G_FILE_RELATIVE_REMAP;
+ bmain = CTX_data_main(C);
+
if (use_userdef) {
/* check userdef before open window, keymaps etc */
- wm_init_userdef(CTX_data_main(C), read_userdef_from_memory);
+ wm_init_userdef(bmain, read_userdef_from_memory);
}
/* match the read WM with current WM */