OSDN Git Service

Win: Fix QThread is destroyed while still running warning
authorTobias Hunger <tobias.hunger@nokia.com>
Tue, 19 Apr 2011 13:48:28 +0000 (15:48 +0200)
committerTobias Hunger <tobias.hunger@nokia.com>
Tue, 19 Apr 2011 13:49:11 +0000 (15:49 +0200)
src/plugins/projectexplorer/windebuginterface.cpp
src/plugins/projectexplorer/windebuginterface.h

index b9247a7..3fc4c2d 100644 (file)
@@ -50,6 +50,12 @@ WinDebugInterface::WinDebugInterface(QObject *parent) :
     start();
 }
 
+WinDebugInterface::~WinDebugInterface()
+{
+    terminate(); // Creator is shutting down anyway, no need to clean up.
+    wait(500);
+}
+
 void WinDebugInterface::run()
 {
     HANDLE bufferReadyEvent = CreateEvent(NULL, FALSE, FALSE, L"DBWIN_BUFFER_READY");
index f652b2e..a51d0a4 100644 (file)
@@ -46,6 +46,8 @@ class WinDebugInterface : public QThread
 
 public:
     explicit WinDebugInterface(QObject *parent = 0);
+    ~WinDebugInterface();
+
     static WinDebugInterface *instance();
 
 signals: