From f39a272a6660bfc2d507e374f12043ffa47a8caa Mon Sep 17 00:00:00 2001 From: Robert Knight Date: Thu, 16 Aug 2007 11:54:50 +0000 Subject: [PATCH] Attempt to fix sporadic crash on exit when process snapshot timer fires after the session has been deleted. svn path=/trunk/KDE/kdebase/apps/konsole/; revision=700765 --- src/SessionController.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/SessionController.cpp b/src/SessionController.cpp index 21c719f82..f8abef925 100644 --- a/src/SessionController.cpp +++ b/src/SessionController.cpp @@ -117,7 +117,10 @@ SessionController::SessionController(Session* session , TerminalDisplay* view, Q // take a snapshot of the session state every so often when // user activity occurs - QTimer* activityTimer = new QTimer(this); + // + // the timer is owned by the session so that it will be destroyed along + // with the session + QTimer* activityTimer = new QTimer(_session); activityTimer->setSingleShot(true); activityTimer->setInterval(2000); connect( _view , SIGNAL(keyPressedSignal(QKeyEvent*)) , activityTimer , SLOT(start()) ); @@ -144,8 +147,7 @@ void SessionController::requireUrlFilterUpdate() } void SessionController::snapshot() { - //qDebug() << "session" << _session->title(Session::NameRole) << "snapshot"; - + Q_ASSERT( _session != 0 ); ProcessInfo* process = 0; ProcessInfo* snapshot = ProcessInfo::newInstance(_session->processId());