From 572401fd809447c1ee0737fc87c0a6c19aec696c Mon Sep 17 00:00:00 2001 From: Palana Date: Tue, 28 Oct 2014 23:49:20 +0100 Subject: [PATCH] Add missing copy/move operations for OBSSignal --- libobs/obs.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/libobs/obs.hpp b/libobs/obs.hpp index 9e9fc35a5..3e3351aa3 100644 --- a/libobs/obs.hpp +++ b/libobs/obs.hpp @@ -150,4 +150,35 @@ public: param = 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; + } };