Add missing copy/move operations for OBSSignal

master
Palana 2014-10-28 23:49:20 +01:00
parent 60cc91f9c9
commit 572401fd80
1 changed files with 31 additions and 0 deletions

View File

@ -150,4 +150,35 @@ public:
param = param_; param = param_;
signal_handler_connect(handler, signal, callback, param); signal_handler_connect(handler, signal, callback, param);
} }
OBSSignal(const OBSSignal&) = delete;
OBSSignal(OBSSignal &&other)
: handler (other.handler),
signal (other.signal),
callback(other.callback),
param (other.param)
{
other.handler = nullptr;
other.signal = nullptr;
other.callback = nullptr;
other.param = nullptr;
}
OBSSignal &operator=(const OBSSignal &) = delete;
OBSSignal &operator=(OBSSignal &&other)
{
Disconnect();
handler = other.handler;
signal = other.signal;
callback = other.callback;
param = other.param;
other.handler = nullptr;
other.signal = nullptr;
other.callback = nullptr;
other.param = nullptr;
return *this;
}
}; };