Diffstat (limited to 'core/tools/quicklauncher/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/tools/quicklauncher/main.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/core/tools/quicklauncher/main.cpp b/core/tools/quicklauncher/main.cpp index 7d368ab..cc411fd 100644 --- a/core/tools/quicklauncher/main.cpp +++ b/core/tools/quicklauncher/main.cpp @@ -11,33 +11,39 @@ ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <qpainter.h> #include <qstrlist.h> #include <qtimer.h> #include <qguardedptr.h> #include <qcopchannel_qws.h> #define QTOPIA_INTERNAL_INITAPP + +#ifdef private +# undef private +#endif +#define private public #include <qtopia/qpeapplication.h> +#undef private #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include "dropins.h" static QPEApplication *app = 0; static PluginLoader *loader = 0; static ApplicationInterface *appIface = 0; static QGuardedPtr<QWidget> mainWindow; #ifdef _OS_LINUX_ static char **argv0 = 0; static int argv_lth; @@ -222,26 +228,38 @@ int main( int argc, char** argv ) } // Create a widget to force initialization of title bar images, etc. QObject::disconnect(app, SIGNAL(lastWindowClosed()), app, SLOT(hideOrQuit())); QWidget *w = new QWidget(0,0,Qt::WDestructiveClose|Qt::WStyle_ContextHelp|Qt::WStyle_Tool); w->setGeometry( -100, -100, 10, 10 ); w->show(); QTimer::singleShot( 0, w, SLOT(close()) ); app->enter_loop(); } int rv = app->exec(); if ( mainWindow ) delete (QWidget*)mainWindow; + + delete app; if ( appIface ) loader->releaseInterface( appIface ); delete loader; - - delete app; + // Neither QLibrary nor my Dropin is a QObject and they don't depend + // on a qApp so we destroy QWidget::destroyMapper() without + // crashing the app + // + // The problem is there are some 'static' resources not freed + // in the apps and on destructing these objects are not available + // anymore. In future fix up the apps but for now + // we just skip deletion and hope things go well -zecke +// delete app; + // hack instead -zecke +// delete app->pidChannel; +// app->pidChannel = 0; return rv; } #include "main.moc" |