Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.3
-
None
Description
When COM/DCOM component returns an array in VARIANT, ActiveQt component unwraps it correctly and subsequently calls VariantClear WinAPI function to release the resources. Although this works correctly for most of data types returned in VARIANT, it does not in case of the arrays.
When an array is wrapped in VARIANT type, a SafeArray functions shall be used. Especially, calling VariantClear function will result an error stating that the data type is invalid. Here, Instead of VariantClear(), SafeArrayDestroy() shall be used:
SAFEARRAY *lpSA = V_ARRAY(variant);
[...]
... work with array...
[...]
SafeArrayDestroy(lpSA);
Not doing so will cause huge memory leak (in my case about 50MB per second, as I was calling a COM method returning large amount of data). I have noticed it in Qt6.5.3 LTS although other versions might be affected too.