From ead277381321a446c1eb9735cf798be856efb21a Mon Sep 17 00:00:00 2001 From: "seer-by-sentry[bot]" <157164994+seer-by-sentry[bot]@users.noreply.github.com> Date: Sun, 25 Jan 2026 06:58:42 +0000 Subject: [PATCH] Fix REF_PTR_SET macro self-assignment bug --- Core/Libraries/Source/WWVegas/WWLib/refcount.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/Libraries/Source/WWVegas/WWLib/refcount.h b/Core/Libraries/Source/WWVegas/WWLib/refcount.h index 9e39b9ba02f..0ee51b4af7a 100644 --- a/Core/Libraries/Source/WWVegas/WWLib/refcount.h +++ b/Core/Libraries/Source/WWVegas/WWLib/refcount.h @@ -60,7 +60,7 @@ struct ActiveRefStruct ** you want to point it at some object. You must release whatever it currently points at, ** point it at the new object, and add-ref the new object (if its not null...) */ -#define REF_PTR_SET(dst,src) { if (src) (src)->Add_Ref(); if (dst) (dst)->Release_Ref(); (dst) = (src); } +#define REF_PTR_SET(dst,src) { auto _ref_tmp = (dst); (dst) = (src); if (src) (src)->Add_Ref(); if (_ref_tmp) (_ref_tmp)->Release_Ref(); } #define REF_PTR_RELEASE(x) { if (x) x->Release_Ref(); x = nullptr; }