On Windows, warn if a thread was terminated with its QThread still in running state.

I hope this catches if the data cache serializer is killed in the middle of a save.
This commit is contained in:
Mathew Sutcliffe
2016-08-10 16:50:54 +01:00
parent f8fc82019d
commit a30eb18a9c
2 changed files with 47 additions and 5 deletions

View File

@@ -32,6 +32,7 @@
#include <algorithm>
#include <functional>
#include <type_traits>
#include <atomic>
namespace BlackMisc
{
@@ -96,11 +97,14 @@ namespace BlackMisc
CRegularThread(QObject *parent = nullptr) : QThread(parent) {}
//! Destructor
~CRegularThread()
{
quit();
wait();
}
~CRegularThread();
protected:
//! \copydoc QThread::run
virtual void run() override;
private:
std::atomic<void *> m_handle { nullptr };
};
/*!