浏览代码

libobs: Fix move assignment operator for ComPtr

We can't compare addresses of ComPtr for self-reference directly because
the address-of operator is overloaded, causing a compiler error. This
fix more or less matches the WRL implementation.
James Park 6 年之前
父节点
当前提交
a3e5344cce
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      libobs/util/windows/ComPtr.hpp

+ 1 - 1
libobs/util/windows/ComPtr.hpp

@@ -68,7 +68,7 @@ public:
 
 	inline ComPtr<T> &operator=(ComPtr<T> &&c)
 	{
-		if (this != &c) {
+		if (&ptr != &c.ptr) {
 			Kill();
 			ptr = c.ptr;
 			c.ptr = nullptr;