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:
authorTon Roosendaal <ton@blender.org>2008-12-21 15:43:34 +0300
committerTon Roosendaal <ton@blender.org>2008-12-21 15:43:34 +0300
commitc694c8f39e76809176176eb7f57b9e25cf5886e9 (patch)
tree2422b8184f15a2c7f7b03b0515f16267b6c0e470 /source/blender/windowmanager
parentb163840dfb858bb40493f2e4b39d802aa923241e (diff)
2.5
- Bugfix: loading files should close running handlers and subwindows, gave memory leaks that way. - Bugfix: space image copy function didn't do curvemap - Cleanup: moved view operators from view3d_select to view3d_view
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_files.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 00297a56167..2c05ce07f48 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -368,6 +368,16 @@ static void wm_window_match_init(bContext *C, ListBase *wmlist)
*wmlist= G.main->wm;
G.main->wm.first= G.main->wm.last= NULL;
+ /* first wrap up running stuff */
+ /* code copied from wm_init_exit.c */
+ for(wm= wmlist->first; wm; wm= wm->id.next) {
+ for(win= wm->windows.first; win; win= win->next) {
+
+ CTX_wm_window_set(C, win); /* needed by operator close callbacks */
+ ED_screen_exit(C, win, win->screen);
+ }
+ }
+
return;
if(wm==NULL) return;
if(G.fileflags & G_FILE_NO_UI) return;
@@ -389,13 +399,13 @@ return;
4- current wm, and wm in file: try match ghostwin
*/
-static void wm_window_match_do(bContext *C, ListBase *wmlist)
+static void wm_window_match_do(bContext *C, ListBase *oldwmlist)
{
wmWindowManager *oldwm, *wm;
wmWindow *oldwin, *win;
/* cases 1 and 2 */
- if(wmlist->first==NULL) {
+ if(oldwmlist->first==NULL) {
if(G.main->wm.first); /* nothing todo */
else
wm_add_default(C);
@@ -407,7 +417,7 @@ static void wm_window_match_do(bContext *C, ListBase *wmlist)
if(G.main->wm.first==NULL) {
/* match oldwm to new dbase, only old files */
- for(wm= wmlist->first; wm; wm= wm->id.next) {
+ for(wm= oldwmlist->first; wm; wm= wm->id.next) {
for(win= wm->windows.first; win; win= win->next) {
win->screen= (bScreen *)find_id("SR", win->screenname);
@@ -420,12 +430,12 @@ static void wm_window_match_do(bContext *C, ListBase *wmlist)
}
/* XXX still solve, case where multiple windows open */
- G.main->wm= *wmlist;
+ G.main->wm= *oldwmlist;
}
else {
/* what if old was 3, and loaded 1? */
/* this code could move to setup_appdata */
- oldwm= wmlist->first;
+ oldwm= oldwmlist->first;
wm= G.main->wm.first;
/* only first wm in list has ghostwins */
for(win= wm->windows.first; win; win= win->next) {
@@ -437,7 +447,7 @@ static void wm_window_match_do(bContext *C, ListBase *wmlist)
}
}
}
- wm_close_and_free_all(C, wmlist);
+ wm_close_and_free_all(C, oldwmlist);
}
}
}