ui: clean up the allocated memory when screen turns off 34/26134/1
authorhyunjin816.lee <hyunjin816.lee@samsung.com>
Mon, 18 Aug 2014 08:46:20 +0000 (17:46 +0900)
committerhyunjin816.lee <hyunjin816.lee@samsung.com>
Mon, 18 Aug 2014 08:46:20 +0000 (17:46 +0900)
register MaruDisplayChangeListener fini function and clean up some of allocated memory
In order to clean up the mainwindow instance, it is neccessary to modify

Change-Id: I1e15d15b1afba71a21a95a62f8bf01789e6d7ab1
Signed-off-by: hyunjin816.lee <hyunjin816.lee@samsung.com>
tizen/src/display/maru_display.h
tizen/src/display/qt5.c
tizen/src/display/qt5_supplement.cpp
tizen/src/display/qt5_supplement.h

index a4814cbfd3e864495bbb8bbb0b72b17296faf98b..27bf9e925ae81b3a4f0c43d5ff8e45d3a9dffbcf 100644 (file)
@@ -77,4 +77,5 @@ void maru_qt5_display_early_init(void);
 
 void maru_qt5_display_init(MaruDisplayChangeListener *mdcl, int full_screen);
 
+void maru_qt5_display_quit(void);
 #endif /* __MARU_DISPLAY_H__ */
index e1ef860f473a13be995f70c5a310cc49255111a2..014a0de98d42449365baf98dec643d86f144569c 100644 (file)
@@ -110,6 +110,15 @@ void maru_qt5_display_early_init(void)
 #endif
 }
 
+void maru_qt5_display_quit(void)
+{
+    if (qt5_console) {
+        g_free(qt5_console);
+        qt5_console = NULL;
+    }
+    qt5_destroy();
+}
+
 void maru_qt5_display_init(MaruDisplayChangeListener *mdcl, int full_screen)
 {
     int i;
@@ -141,6 +150,7 @@ void maru_qt5_display_init(MaruDisplayChangeListener *mdcl, int full_screen)
         register_displaychangelistener(&qt5_console[i].dcl);
         qt5_console[i].idx = i;
     }
+    mdcl->fini = maru_qt5_display_quit;
 
     if (full_screen) {
         // TODO
index 76c9a8f447ec4502d1a63a8e42881289cc61b698..c7bdc72f03c041c8e51a0030ca0d535f0b15749a 100644 (file)
@@ -117,6 +117,14 @@ void qt5_skin_init(void)
     mainwindow->startSwapper();
 }
 
+void qt5_destroy()
+{
+    qDebug("qt5 destroy");
+    delete uiInfo;
+    mainwindow->closeController();
+    /* TODO : destroy mainwindow and qt5App */
+}
+
 void qt5_early_prepare(void)
 {
     Q_INIT_RESOURCE(resource);
index 1c7af9e1f32e748509f451edc52265171b4dc56f..0dfb5bef90729261e3817ecbd2013b51b07bbd18 100644 (file)
@@ -36,6 +36,7 @@ void qt5_graphic_hw_invalidate(void);
 int qt5_graphic_hw_display(void);
 void qt5_early_prepare(void);
 void qt5_prepare(void);
+void qt5_destroy(void);
 
 void qt5_update_internal(void *data, int width, int height);
 void qt5_switch_internal(void);