qt: fix closing process
authorMunkyu Im <munkyu.im@samsung.com>
Thu, 11 Jun 2015 11:00:34 +0000 (20:00 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 22 Jun 2015 05:27:50 +0000 (14:27 +0900)
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 <munkyu.im@samsung.com>
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
tizen/src/display/qt5.c
tizen/src/display/qt5_supplement.cpp
tizen/src/display/qt5_supplement.h
tizen/src/ui/mainwindow.cpp

index 0fcd230a748d9ae77d20f9d8ce3220a52c6665a6..d4fd5a0d35443a296a977ffce1eda68bc2edeeab 100644 (file)
@@ -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;
index d729e85072acdf5348e3cce08214f2f43a16730a..51874055730739c0c21e08307ea02362d29ddc0e 100644 (file)
@@ -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)
index d9a91894447396b0dc5b8b03ea81dca3830b7655..89cbf7f34c9b64f91fd00800078a1053f45d460d 100644 (file)
@@ -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);
index 54c7d470ab4506ede5df39f9e543988637d9b919..b8b0c7ba6a37f5e8a92673665c6e68912659fc7f 100644 (file)
@@ -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();
     }
 }