From f62c76df912cbf3fafadc46a90f05ed84cb5927a Mon Sep 17 00:00:00 2001 From: Munkyu Im Date: Thu, 11 Jun 2015 20:00:34 +0900 Subject: [PATCH] qt: fix closing process delete all instances. fix closing swapper thread. notice: But with Qt, no QObject can be instantiated before QApplication. QApplication sets up the proper environment. (e.g. mainwindow, uiInfo) Change-Id: I9a14de855da52298becc9fa54ed904f5e7fd971c Signed-off-by: Munkyu Im Signed-off-by: Vasiliy Ulyanov --- tizen/src/display/qt5.c | 11 +++++++---- tizen/src/display/qt5_supplement.cpp | 5 ++--- tizen/src/display/qt5_supplement.h | 1 + tizen/src/ui/mainwindow.cpp | 5 ++++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/tizen/src/display/qt5.c b/tizen/src/display/qt5.c index 0fcd230..d4fd5a0 100644 --- a/tizen/src/display/qt5.c +++ b/tizen/src/display/qt5.c @@ -51,6 +51,11 @@ void qt5_graphic_hw_invalidate(void) graphic_hw_invalidate(NULL); } +void qt5_graphic_hw_update(void) +{ + graphic_hw_update(NULL); +} + int qt5_graphic_hw_display(void) { console_ch_t displayed = 0; @@ -134,8 +139,6 @@ void maru_qt5_display_early_init(bool isOnscreen) void maru_qt5_display_quit(void) { - qt5_destroy(); - if (qt5_console) { g_free(qt5_console); qt5_console = NULL; @@ -145,7 +148,6 @@ void maru_qt5_display_quit(void) void maru_qt5_display_init(MaruDisplayChangeListener *mdcl, int full_screen) { int i; - #ifdef SDL_THREAD qemu_mutex_init(&sdl_mutex); qemu_cond_init(&sdl_cond); @@ -173,11 +175,12 @@ 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; + //mdcl->fini = maru_qt5_display_quit; if (full_screen) { /* TODO */ } + atexit(qt5_destroy); /* TODO mouse_mode_notifier.notify = qt2_mouse_mode_change; diff --git a/tizen/src/display/qt5_supplement.cpp b/tizen/src/display/qt5_supplement.cpp index d729e85..5187405 100644 --- a/tizen/src/display/qt5_supplement.cpp +++ b/tizen/src/display/qt5_supplement.cpp @@ -259,12 +259,11 @@ void qt5_destroy() /* clean up */ mainwindow->terminateDisplaySwapper(); - mainwindow->closeController(); - /* TODO : destroy mainwindow and qt5App */ - delete uiInfo; + delete mainwindow; + delete qt5App; } void qt5_early_prepare(bool isOnscreen) diff --git a/tizen/src/display/qt5_supplement.h b/tizen/src/display/qt5_supplement.h index d9a9189..89cbf7f 100644 --- a/tizen/src/display/qt5_supplement.h +++ b/tizen/src/display/qt5_supplement.h @@ -35,6 +35,7 @@ extern "C" { #endif void qt5_graphic_hw_invalidate(void); +void qt5_graphic_hw_update(void); int qt5_graphic_hw_display(void); void qt5_early_prepare(bool isOnscreen); void qt5_prepare(void); diff --git a/tizen/src/ui/mainwindow.cpp b/tizen/src/ui/mainwindow.cpp index 54c7d47..b8b0c7b 100644 --- a/tizen/src/ui/mainwindow.cpp +++ b/tizen/src/ui/mainwindow.cpp @@ -36,6 +36,7 @@ #include "displayswwidget.h" extern "C" { +void qt5_graphic_hw_update(void); int qt5_graphic_hw_display(void); } @@ -68,6 +69,8 @@ void DisplaySwapper::display() qt5_graphic_hw_display(); } } + + qDebug("DisplaySwapper::display() terminated"); } MainWindow::MainWindow(UIInformation *uiInfo, QWidget *parent) : @@ -208,7 +211,7 @@ void MainWindow::terminateDisplaySwapper() { if (swapper != NULL) { swapper->setTerminating(); - qt5_graphic_hw_invalidate(); + qt5_graphic_hw_update(); } } -- 2.7.4