svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r22130:22205
[blender-staging.git] / source / blender / windowmanager / intern / wm_init_exit.c
index adbc43e439db31f7c5e6e5eb13fc8aa89e129396..599844f10202e94abda1c340e65b9ad0ae0f2f75 100644 (file)
@@ -51,6 +51,7 @@
 #include "BKE_global.h"
 #include "BKE_library.h"
 #include "BKE_mball.h"
+#include "BKE_report.h"
 #include "BKE_utildefines.h"
 #include "BKE_packedFile.h"
 
@@ -58,8 +59,6 @@
 
 #include "RE_pipeline.h"               /* RE_ free stuff */
 
-#include "radio.h"
-
 #ifndef DISABLE_PYTHON
 #include "BPY_extern.h"
 #endif
@@ -102,6 +101,18 @@ static void sound_init_listener(void)
        G.listener->dopplervelocity = 340.29f;
 }
 
+
+static void wm_init_reports(bContext *C)
+{
+       BKE_reports_init(CTX_wm_reports(C), RPT_STORE);
+}
+static void wm_free_reports(bContext *C)
+{
+       BKE_reports_clear(CTX_wm_reports(C));
+}
+
+
+
 /* only called once, for startup */
 void WM_init(bContext *C)
 {
@@ -126,6 +137,8 @@ void WM_init(bContext *C)
        /* get the default database, plus a wm */
        WM_read_homefile(C, NULL);
        
+       wm_init_reports(C); /* reports cant be initialized before the wm */
+       
        UI_init();
        
        //      clear_matcopybuf(); /* XXX */
@@ -165,6 +178,7 @@ extern wchar_t *copybufinfo;
 
        // XXX copy/paste buffer stuff...
 extern void free_anim_copybuf(); 
+extern void free_posebuf(); 
 
 /* called in creator.c even... tsk, split this! */
 void WM_exit(bContext *C)
@@ -195,10 +209,6 @@ void WM_exit(bContext *C)
 //     BIF_GlobalReebFree();
 //     BIF_freeRetarget();
        BIF_freeTemplates(C);
-       BIF_freeSketch(C);
-
-       /* Context should still working here. but radio tool needs cleaning... */
-       freeAllRad(CTX_data_scene(C));
        
        free_ttfont(); /* bke_font.h */
        
@@ -218,9 +228,11 @@ void WM_exit(bContext *C)
        
        fastshade_free_render();        /* shaded view */
        ED_preview_free_dbase();        /* frees a Main dbase, before free_blender! */
+       wm_free_reports(C);                     /* before free_blender! - since the ListBases get freed there */
        free_blender();                         /* blender.c, does entire library and spacetypes */
 //     free_matcopybuf();
        free_anim_copybuf();
+       free_posebuf();
 //     free_vertexpaint();
 //     free_imagepaint();
        
@@ -229,6 +241,7 @@ void WM_exit(bContext *C)
        BLF_exit();
 
        RE_FreeAllRender();
+       RE_engines_exit();
        
 //     free_txt_data();