From: hyunjin816.lee Date: Mon, 18 Aug 2014 08:46:20 +0000 (+0900) Subject: ui: clean up the allocated memory when screen turns off X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=03c99ea3cb2598f1527cfa99364ffa71ba308a33;p=sdk%2Femulator%2Fqemu.git ui: clean up the allocated memory when screen turns off 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 --- diff --git a/tizen/src/display/maru_display.h b/tizen/src/display/maru_display.h index a4814cbfd3..27bf9e925a 100644 --- a/tizen/src/display/maru_display.h +++ b/tizen/src/display/maru_display.h @@ -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__ */ diff --git a/tizen/src/display/qt5.c b/tizen/src/display/qt5.c index e1ef860f47..014a0de98d 100644 --- a/tizen/src/display/qt5.c +++ b/tizen/src/display/qt5.c @@ -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 diff --git a/tizen/src/display/qt5_supplement.cpp b/tizen/src/display/qt5_supplement.cpp index 76c9a8f447..c7bdc72f03 100644 --- a/tizen/src/display/qt5_supplement.cpp +++ b/tizen/src/display/qt5_supplement.cpp @@ -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); diff --git a/tizen/src/display/qt5_supplement.h b/tizen/src/display/qt5_supplement.h index 1c7af9e1f3..0dfb5bef90 100644 --- a/tizen/src/display/qt5_supplement.h +++ b/tizen/src/display/qt5_supplement.h @@ -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);