Re: [Mingw-w64-public] [PATCH] Fix reference counting bug in Microsoft::WRL::ComPtr::Attach

2023-06-17 Thread LIU Hao

在 2023-06-16 17:27, Jøger Hansegård via Mingw-w64-public 写道:

Microsoft::WRL::ComPtr::Attach should take ownership of an interface and
must therefore not increment the reference count of the attached
interface pointer.

This patch fixes this issue, and makes the MINGW64 implementation
behave the same way as the implementation shipped with the Microsoft
SDK.

Fixes: #892 Microsoft::WRL::ComPtr::Attach leaks references
Signed-off-by: Jøger Hansegård
---
  mingw-w64-headers/include/wrl/client.h | 1 -
  1 file changed, 1 deletion(-)


Apologies for this so obvious mistake, and, thanks for the patch. Pushed to 
master now.


--
Best regards,
LIU Hao



OpenPGP_signature
Description: OpenPGP digital signature
___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


[Mingw-w64-public] [PATCH] Fix reference counting bug in Microsoft::WRL::ComPtr::Attach

2023-06-16 Thread Jøger Hansegård via Mingw-w64-public
From 47baf71618146b3fd5fc6ec92c326acb9a026cce Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=B8ger=20Hanseg=C3=A5rd?= 
Date: Fri, 16 Jun 2023 11:08:00 +0200
Subject: [PATCH] Fix reference counting bug in Microsoft::WRL::ComPtr::Attach
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Microsoft::WRL::ComPtr::Attach should take ownership of an interface and
must therefore not increment the reference count of the attached
interface pointer.

This patch fixes this issue, and makes the MINGW64 implementation
behave the same way as the implementation shipped with the Microsoft
SDK.

Fixes: #892 Microsoft::WRL::ComPtr::Attach leaks references
Signed-off-by: Jøger Hansegård 
---
 mingw-w64-headers/include/wrl/client.h | 1 -
 1 file changed, 1 deletion(-)

diff --git a/mingw-w64-headers/include/wrl/client.h 
b/mingw-w64-headers/include/wrl/client.h
index 12239e108..aeb886ea8 100644
--- a/mingw-w64-headers/include/wrl/client.h
+++ b/mingw-w64-headers/include/wrl/client.h
@@ -206,7 +206,6 @@ namespace Microsoft {
 if (ptr_ != other) {
 InternalRelease();
 ptr_ = other;
-InternalAddRef();
 }
 }
 
-- 
2.40.1.windows.1

___
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public