From f9cce334d2285040b3c66e8fdc9d70b3c5010d19 Mon Sep 17 00:00:00 2001 From: derrod Date: Tue, 28 Feb 2023 19:03:20 +0100 Subject: [PATCH] libobs: Add copy constructor for ComQIPtr --- libobs/util/windows/ComPtr.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libobs/util/windows/ComPtr.hpp b/libobs/util/windows/ComPtr.hpp index 5f9a4dbf1..15c48bc15 100644 --- a/libobs/util/windows/ComPtr.hpp +++ b/libobs/util/windows/ComPtr.hpp @@ -165,6 +165,12 @@ public: unk->QueryInterface(__uuidof(T), (void **)&this->ptr); } + template inline ComQIPtr(const ComPtr &c) + { + this->ptr = nullptr; + c->QueryInterface(__uuidof(T), (void **)&this->ptr); + } + inline ComPtr &operator=(IUnknown *unk) { ComPtr::Clear();