明面上没bug了
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <QTimer>
|
||||
#include <QKeyEvent>
|
||||
#include <QThread>
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
|
||||
class Back_End : public QObject {
|
||||
@@ -25,6 +26,13 @@ public:
|
||||
QString get_screenshot_save_file_name();
|
||||
QString get_audio_file_location();
|
||||
void stop_mock_thread() {
|
||||
++mock_generation;
|
||||
if (mock_timer) {
|
||||
mock_timer->stop();
|
||||
mock_timer->disconnect(this);
|
||||
mock_timer->deleteLater();
|
||||
mock_timer = nullptr;
|
||||
}
|
||||
if (mock_thread) {
|
||||
mock_thread->quit();
|
||||
mock_thread->wait();
|
||||
@@ -39,6 +47,8 @@ protected:
|
||||
~Back_End() override {
|
||||
stop_mock_thread();
|
||||
}
|
||||
QTimer* mock_timer{};
|
||||
std::uint64_t mock_generation{};
|
||||
QThread* mock_thread{};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user