From 470ada4454e8a2af391ce432293c243358d31c75 Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 12 Sep 2024 16:37:09 +0100 Subject: [PATCH] ComSmartPtr: Update implementation slightly so that error codes can be inspected during debugging --- modules/juce_core/native/juce_ComSmartPtr_windows.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/juce_core/native/juce_ComSmartPtr_windows.h b/modules/juce_core/native/juce_ComSmartPtr_windows.h index f08528b2bc..385335d203 100644 --- a/modules/juce_core/native/juce_ComSmartPtr_windows.h +++ b/modules/juce_core/native/juce_ComSmartPtr_windows.h @@ -154,10 +154,10 @@ public: { ComSmartPtr destObject; - if (QueryInterface (destObject) == S_OK) - return destObject; + if (const auto hr = QueryInterface (destObject); FAILED (hr)) + return {}; - return {}; + return destObject; } /** Increments refcount. */