Skip to content

Commit

Permalink
ensure no qt faults when switching projects
Browse files Browse the repository at this point in the history
  • Loading branch information
jjallaire committed Jul 15, 2011
1 parent 61559f7 commit ade9cb7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/cpp/desktop/DesktopSessionLauncher.cpp
Expand Up @@ -181,12 +181,22 @@ Error SessionLauncher::launchNextSession()
SIGNAL(finished(int,QProcess::ExitStatus)),
this, SLOT(onRSessionExited()));

// laod url
pMainWindow_->loadUrl(url);
// laod url -- use a delay because on occation we've seen the
// mac client crash during switching of projects and this could
// be some type of timing related issue
nextSessionUrl_ = url;
QTimer::singleShot(50, this, SLOT(onReloadFrameForNextSession()));

return Success();
}

void SessionLauncher::onReloadFrameForNextSession()
{
pMainWindow_->loadUrl(nextSessionUrl_);
nextSessionUrl_.clear();
}


Error SessionLauncher::launchSession(const QStringList& argList,
QProcess** ppRSessionProcess)
{
Expand Down
2 changes: 2 additions & 0 deletions src/cpp/desktop/DesktopSessionLauncher.hpp
Expand Up @@ -51,6 +51,7 @@ class SessionLauncher : public QObject

public slots:
void onRSessionExited();
void onReloadFrameForNextSession();

private:

Expand All @@ -70,6 +71,7 @@ public slots:
ApplicationLaunch* pAppLaunch_;
MainWindow* pMainWindow_;
QProcess* pRSessionProcess_;
QUrl nextSessionUrl_;
};

} // namespace desktop
Expand Down

0 comments on commit ade9cb7

Please sign in to comment.