From d8af5d681ca9a919790092d0f16ef73b38e21dff Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 21 Nov 2010 19:46:06 +0000 Subject: [PATCH] Fix possible infinite loop in qBtSession constructor (when Web UI is enabled) --- src/mainwindow.cpp | 1 + src/qtlibtorrent/qbtsession.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index fd0385b12..05fe33004 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -331,6 +331,7 @@ MainWindow::~MainWindow() { // Delete BTSession objects qDebug("Deleting BTSession"); QBtSession::drop(); + BTSession = 0; // May freeze for a few seconds after the next line // because the Bittorrent session proxy will // actually be deleted now and destruction diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index b2a23e490..23feec56e 100644 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -139,7 +139,7 @@ QBtSession::QBtSession() #endif connect(m_scanFolders, SIGNAL(torrentsAdded(QStringList&)), this, SLOT(addTorrentsFromScanFolder(QStringList&))); // Apply user settings to Bittorrent session - configureSession(); + QTimer::singleShot(0, this, SLOT(configureSession())); qDebug("* BTSession constructed"); }