# # # patch "src/GuitoneStandalone.cpp" # from [cd22aae3cb96d98ce1bdcc9453381d6c440deed0] # to [62f7608f9562638f1c40ecce953aef25c871f222] # ============================================================ --- src/GuitoneStandalone.cpp cd22aae3cb96d98ce1bdcc9453381d6c440deed0 +++ src/GuitoneStandalone.cpp 62f7608f9562638f1c40ecce953aef25c871f222 @@ -74,8 +74,6 @@ GuitoneStandalone::~GuitoneStandalone() // wait until all windows have been closed while (openWindows.size() > 0) QCoreApplication::processEvents(); - - if (openPrompt) delete openPrompt; } void GuitoneStandalone::tryLoadSomething() @@ -110,6 +108,11 @@ void GuitoneStandalone::tryLoadSomething ); connect( + openPrompt, SIGNAL(quitApp()), + openPrompt, SLOT(deleteLater()) + ); + + connect( this, SIGNAL(updateRecentLists()), openPrompt, SLOT(updateRecentLists()) ); @@ -201,9 +204,16 @@ void GuitoneStandalone::loadFromHandle(c triggerUpdateWindowList(); emit updateRecentLists(); - // FIXME: maybe we should signal this instead...? if (openPrompt) + { openPrompt->hide(); + // we delete the cruft and invalidate all the set-up connections + // once we have something loaded to avoid unwanted side effects + // calling delete here directly will fail because there are still + // some signals which might have to be delivered to the dialog + // before + openPrompt->deleteLater(); + } } bool GuitoneStandalone::loadFromString(const QString & pathOrURI)