mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-08 03:35:35 +08:00
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:
@@ -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 };
|
||||
};
|
||||
|
||||
/*!
|
||||
|
||||
Reference in New Issue
Block a user