From e16b57b0767279484b344e1d55057ff38b0247d1 Mon Sep 17 00:00:00 2001 From: Palana Date: Wed, 29 Oct 2014 14:37:53 +0100 Subject: [PATCH] Add missing copy/move operations for OBSObj --- libobs/obs.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libobs/obs.hpp b/libobs/obs.hpp index 3e3351aa3..6bc43ed0c 100644 --- a/libobs/obs.hpp +++ b/libobs/obs.hpp @@ -77,6 +77,8 @@ template class OBSObj { public: inline OBSObj() : obj(nullptr) {} inline OBSObj(T obj_) : obj(obj_) {} + inline OBSObj(const OBSObj&) = delete; + inline OBSObj(OBSObj &&other) : obj(other.obj) { other.obj = nullptr; } inline ~OBSObj() {destroy(obj);} @@ -87,6 +89,15 @@ public: obj = obj_; return *this; } + inline OBSObj &operator=(const OBSObj&) = delete; + inline OBSObj &operator=(OBSObj &&other) + { + if (obj) + destroy(obj); + obj = other.obj; + other.obj = nullptr; + return *this; + } inline operator T() const {return obj;}