From: GiWoong Kim Date: Fri, 4 Mar 2016 09:13:36 +0000 (+0900) Subject: gui: remove memory leak X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~54 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1487a83cff07bce08adc7154597df126fb0b2a96;p=sdk%2Femulator%2Fqemu.git gui: remove memory leak delete MainWindow class before emulator exit Change-Id: Id694cf58d2eebfbb2237e86a4fb7ea42d205bcb1 Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/ui/input/keyboardhelper.cpp b/tizen/src/ui/input/keyboardhelper.cpp index 57560cb130..08370c0dc0 100644 --- a/tizen/src/ui/input/keyboardhelper.cpp +++ b/tizen/src/ui/input/keyboardhelper.cpp @@ -597,5 +597,5 @@ void KeyboardHelper::keyReleased(QKeyEvent *event) KeyboardHelper::~KeyboardHelper() { - qDebug("destroy keyboard helper"); + /* do nothing */ } diff --git a/tizen/src/ui/input/keyboardshortcut.cpp b/tizen/src/ui/input/keyboardshortcut.cpp index 10be0ad3f1..c14f2cfdb6 100644 --- a/tizen/src/ui/input/keyboardshortcut.cpp +++ b/tizen/src/ui/input/keyboardshortcut.cpp @@ -104,7 +104,5 @@ void KeyboardShortcut::slotHwKeyShortcut(int keycode) KeyboardShortcut::~KeyboardShortcut() { - qDebug("destroy keyboard shortcut"); - hwKeyShortcutMap.clear(); } diff --git a/tizen/src/ui/input/touchscreenhelper.cpp b/tizen/src/ui/input/touchscreenhelper.cpp index 4d197c5747..eb168c132f 100644 --- a/tizen/src/ui/input/touchscreenhelper.cpp +++ b/tizen/src/ui/input/touchscreenhelper.cpp @@ -112,8 +112,6 @@ void TouchScreenHelper::touchMoved(QPoint hostPos, QPoint guestPos) TouchScreenHelper::~TouchScreenHelper() { - qDebug("destroy touch screen helper"); - if (mtTracker != NULL) { delete mtTracker; } diff --git a/tizen/src/ui/layout/mainform.cpp b/tizen/src/ui/layout/mainform.cpp index 0489245065..1ecf548adf 100644 --- a/tizen/src/ui/layout/mainform.cpp +++ b/tizen/src/ui/layout/mainform.cpp @@ -57,8 +57,6 @@ QPixmap *MainForm::getRotaryImage() MainForm::~MainForm() { - qDebug("destroy main form"); - if (displayType != NULL) { delete displayType; } diff --git a/tizen/src/ui/menu/advancedmenuitem.cpp b/tizen/src/ui/menu/advancedmenuitem.cpp index 5f4eea45fe..7cbe5561fe 100644 --- a/tizen/src/ui/menu/advancedmenuitem.cpp +++ b/tizen/src/ui/menu/advancedmenuitem.cpp @@ -42,8 +42,6 @@ QList &AdvancedMenuItem::getMenuList() AdvancedMenuItem::~AdvancedMenuItem() { - qDebug("destroy an advanced menu item"); - for (int i = 0; i < menuList.count(); i++) { delete menuList.at(i); } diff --git a/tizen/src/ui/menu/scalemenuitem.cpp b/tizen/src/ui/menu/scalemenuitem.cpp index 931996ec00..d088eba3bc 100644 --- a/tizen/src/ui/menu/scalemenuitem.cpp +++ b/tizen/src/ui/menu/scalemenuitem.cpp @@ -52,7 +52,5 @@ int ScaleMenuItem::getDefaultScaleFactor() ScaleMenuItem::~ScaleMenuItem() { - qDebug("destroy a scale menu item"); - factorMap.clear(); } diff --git a/tizen/src/ui/menu/shellopener.cpp b/tizen/src/ui/menu/shellopener.cpp index 20a95a4dce..cd1bc1d62d 100644 --- a/tizen/src/ui/menu/shellopener.cpp +++ b/tizen/src/ui/menu/shellopener.cpp @@ -84,5 +84,5 @@ void ShellOpener::openShell(QString title) ShellOpener::~ShellOpener() { - qDebug("destroy shell opener"); + /* do nothing */ } diff --git a/tizen/src/ui/qt5_supplement.cpp b/tizen/src/ui/qt5_supplement.cpp index 589cec0b45..f3346e23f3 100644 --- a/tizen/src/ui/qt5_supplement.cpp +++ b/tizen/src/ui/qt5_supplement.cpp @@ -269,6 +269,8 @@ void qt5_destroy() { qDebug("qt5 destroy"); + mainwindow->terminateDisplaySwapper(); + /* write most recently used data information */ QString mruPath( uiInfo->getVmDataPath() + QDir::separator() + GUI_PROPERTIES_FILE); @@ -300,17 +302,15 @@ void qt5_destroy() qt5App->flush(); mainwindow->closeController(); - mainwindow->terminateDisplaySwapper(); qt5App->processEvents(QEventLoop::ExcludeUserInputEvents); qt5App->quit(); -#if 0 - //FIXME: It causes SIGSEGV now... - delete mainwindow; + delete mainwindow; /* All child widgets will be deleted automatically + in accordance with parent-child chain. */ mainwindow = NULL; -#endif - + delete qt5App; + qt5App = NULL; delete uiInfo; uiInfo = NULL; } diff --git a/tizen/src/ui/skinbezelitem.cpp b/tizen/src/ui/skinbezelitem.cpp index 57889d371c..910aed773f 100644 --- a/tizen/src/ui/skinbezelitem.cpp +++ b/tizen/src/ui/skinbezelitem.cpp @@ -55,5 +55,5 @@ bool SkinBezelItem::isHWKeyHandling() SkinBezelItem::~SkinBezelItem() { - qDebug("destroy bezel item"); + /* do nothing */ }