From b03fa326249da7c75e14119abbed092c435e1ed0 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Mon, 3 Jan 2011 21:24:57 +0000 Subject: [PATCH] Avoid possible crash on exit when the IP filter is enabled --- src/qtlibtorrent/filterparserthread.h | 2 ++ src/qtlibtorrent/qbtsession.cpp | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/qtlibtorrent/filterparserthread.h b/src/qtlibtorrent/filterparserthread.h index 4fee9971c..08a46cfd6 100644 --- a/src/qtlibtorrent/filterparserthread.h +++ b/src/qtlibtorrent/filterparserthread.h @@ -407,6 +407,8 @@ protected: ruleCount = parseDATFilterFile(filePath); } } + if(abort) + return; try { s->set_ip_filter(filter); emit IPFilterParsed(ruleCount); diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index ca385fe86..d034a8d40 100644 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -161,9 +161,6 @@ QBtSession::~QBtSession() { #endif saveSessionState(); saveFastResumeData(); - qDebug("Deleting the session"); - delete s; - qDebug("Session deleted"); // Delete our objects if(m_tracker) delete m_tracker; @@ -178,6 +175,8 @@ QBtSession::~QBtSession() { // HTTP Server if(httpServer) delete httpServer; + qDebug("Deleting the session"); + delete s; qDebug("BTSession destructor OUT"); }