diff --git a/src/qrcore.cpp b/src/qrcore.cpp index 7532376a..dbbb14cc 100644 --- a/src/qrcore.cpp +++ b/src/qrcore.cpp @@ -10,8 +10,9 @@ RCoreLocked::RCoreLocked(RCore *core) } RCoreLocked::RCoreLocked(RCoreLocked&& o) + : core(o.core) { - core = o.core; + o.core = nullptr; } RCoreLocked::~RCoreLocked() diff --git a/src/qrcore.h b/src/qrcore.h index 751fcfee..55513fca 100644 --- a/src/qrcore.h +++ b/src/qrcore.h @@ -27,8 +27,11 @@ #define __alert(x) QMessageBox::question (this, "Alert", QString(x), QMessageBox::Ok) #define __question(x) (QMessageBox::Yes==QMessageBox::question (this, "Alert", QString(x), QMessageBox::Yes| QMessageBox::No)) -struct RCoreLocked +class RCoreLocked { + RCore* core; + +public: explicit RCoreLocked(RCore* core); RCoreLocked(const RCoreLocked&) = delete; RCoreLocked& operator=(const RCoreLocked&) = delete; @@ -36,9 +39,6 @@ struct RCoreLocked ~RCoreLocked(); operator RCore*() const; RCore* operator->() const; - -private: - RCore* core; }; #define QNOTUSED(x) do { (void)(x); } while ( 0 );