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:
authorCampbell Barton <ideasman42@gmail.com>2011-11-15 20:38:48 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-11-15 20:38:48 +0400
commit0c7a25cd0ec8e1aaa853de6f5ec67e030917e15a (patch)
tree598c1092743b1c7d0707f5bf93a200a443197198 /source/blender/windowmanager
parentf403d9a2b1128565c503755668c7bc001ecb2eb3 (diff)
patch [#28993] wm_window_match_do(): Fix crash on null pointer dereference
from Ola Jeppsson (olajep) also some cleanup edits
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_apple.c4
-rw-r--r--source/blender/windowmanager/intern/wm_files.c11
2 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/windowmanager/intern/wm_apple.c b/source/blender/windowmanager/intern/wm_apple.c
index c19523cbaee..e17441873d5 100644
--- a/source/blender/windowmanager/intern/wm_apple.c
+++ b/source/blender/windowmanager/intern/wm_apple.c
@@ -98,8 +98,8 @@ static int checkAppleVideoCard(void)
StandardAlert ( kAlertStopAlert, (ConstStr255Param) &inError, (ConstStr255Param)&inText,NULL,&junkHit);
abort();
}
-CGLDestroyRendererInfo (rend);
-return 0;
+ CGLDestroyRendererInfo (rend);
+ return 0;
}
static void getMacAvailableBounds(short *top, short *left, short *bottom, short *right)
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 8d7e812a386..1a7031c7d31 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -155,8 +155,9 @@ static void wm_window_match_init(bContext *C, ListBase *wmlist)
CTX_wm_window_set(C, active_win);
ED_editors_exit(C);
-
-return;
+
+ /* just had return; here from r12991, this code could just get removed?*/
+#if 0
if(wm==NULL) return;
if(G.fileflags & G_FILE_NO_UI) return;
@@ -168,6 +169,7 @@ return;
//BLI_addtail(screenbase, win->screen);
}
}
+#endif
}
/* match old WM with new, 4 cases:
@@ -193,9 +195,10 @@ static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
/* we've read file without wm..., keep current one entirely alive */
if(G.main->wm.first==NULL) {
+ bScreen *screen= NULL;
+
/* when loading without UI, no matching needed */
- if(!(G.fileflags & G_FILE_NO_UI)) {
- bScreen *screen= CTX_wm_screen(C);
+ if(!(G.fileflags & G_FILE_NO_UI) && (screen= CTX_wm_screen(C))) {
/* match oldwm to new dbase, only old files */
for(wm= oldwmlist->first; wm; wm= wm->id.next) {