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>2009-08-05 06:40:51 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-08-05 06:40:51 +0400
commit8aa33834087bf5e717c0b671254d528d93cf6001 (patch)
tree8496f2b372b4faaab90ff0129d14e79366d2d448 /source/blender/windowmanager
parent2a999890fb0c9839e8eb7666ce58178fac7da538 (diff)
fix for ghost memory leaks
- ghost data wasn't being freed (added wm_ghost_exit() call to wm_init_exit.c) - GHOST_EventManager wasn't freeing GHOST_IEventConsumer's - ghost/X11 wasnt calling XCloseDisplay(), some junk from X11 wasnt being freed - ghost/X11 XAllocNamedColor wasn't freeing the colors when done making a custom cursor.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c2
-rw-r--r--source/blender/windowmanager/intern/wm_window.c8
-rw-r--r--source/blender/windowmanager/wm_window.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 599844f1020..7179efb186d 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -274,6 +274,8 @@ void WM_exit(bContext *C)
RNA_exit();
+ wm_ghost_exit();
+
CTX_free(C);
if(MEM_get_memory_blocks_in_use()!=0) {
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 31e6de2527b..4d80836dd05 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -756,6 +756,14 @@ void wm_ghost_init(bContext *C)
}
}
+void wm_ghost_exit(void)
+{
+ if(g_system)
+ GHOST_DisposeSystem(g_system);
+
+ g_system= NULL;
+}
+
/* **************** timer ********************** */
/* to (de)activate running timers temporary */
diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.h
index c2a2b00b796..f159f7f098d 100644
--- a/source/blender/windowmanager/wm_window.h
+++ b/source/blender/windowmanager/wm_window.h
@@ -33,6 +33,7 @@ struct bScreen;
/* *************** internal api ************** */
void wm_ghost_init (bContext *C);
+void wm_ghost_exit(void);
wmWindow *wm_window_new (bContext *C);
void wm_window_free (bContext *C, wmWindow *win);