From a510facf18624a1c73877823ddc1ca3384a4428c Mon Sep 17 00:00:00 2001 From: Timon Wong Date: Wed, 29 May 2013 14:17:12 +0800 Subject: [PATCH] Fix potential crash on exit with multiple tabs opened --- mainwindow.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mainwindow.cc b/mainwindow.cc index 78a62fe3..ef68a87f 100644 --- a/mainwindow.cc +++ b/mainwindow.cc @@ -1544,7 +1544,9 @@ void MainWindow::tabSwitched( int ) updateWindowTitle(); if (mruList.size() > 1) { - mruList.move(mruList.indexOf(ui.tabWidget->widget(ui.tabWidget->currentIndex())),0); + int from = mruList.indexOf( ui.tabWidget->widget( ui.tabWidget->currentIndex() ) ); + if ( from > 0) + mruList.move( from, 0 ); } }