From: Dmitrii Kulikov <164657232+AtheneNoctuaPt@users.noreply.github.com> Date: Fri, 18 Jul 2025 15:58:59 +0000 (+0100) Subject: Foundation classes - Leak of WinAPI resources. (#625) X-Git-Tag: V8_0_0_rc2~19 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=45f4afb8c76b7d7d81ea9fd80d98f2a26ae95b31;p=occt.git Foundation classes - Leak of WinAPI resources. (#625) - Replaces raw IWICBitmapFlipRotator pointer with Image_ComPtr smart pointer wrapper - Updates pointer access patterns to use smart pointer methods (.ChangePtr() and .get()) - Maintains existing functionality while improving resource management --- diff --git a/src/Visualization/TKService/Image/Image_AlienPixMap.cxx b/src/Visualization/TKService/Image/Image_AlienPixMap.cxx index 6ed2b76797..7e14e9e62d 100644 --- a/src/Visualization/TKService/Image/Image_AlienPixMap.cxx +++ b/src/Visualization/TKService/Image/Image_AlienPixMap.cxx @@ -922,13 +922,13 @@ bool Image_AlienPixMap::Load(const Standard_Byte* theData, aWicSrc = aWicConvertedFrame.get(); } - IWICBitmapFlipRotator* aRotator; - bool isTopDown = true; - if (aWicImgFactory->CreateBitmapFlipRotator(&aRotator) == S_OK + Image_ComPtr aRotator; + bool isTopDown = true; + if (aWicImgFactory->CreateBitmapFlipRotator(&aRotator.ChangePtr()) == S_OK && aRotator->Initialize(aWicSrc, WICBitmapTransformFlipVertical) == S_OK) { isTopDown = false; - aWicSrc = aRotator; + aWicSrc = aRotator.get(); } if (aWicSrc->CopyPixels(NULL, (UINT)SizeRowBytes(), (UINT)SizeBytes(), ChangeData()) != S_OK)