Two windows applications communicate via the windows com interface. By calling a function which returns a QVariant containing a list of QVariant with approx 2000 items of double.
Memory is leaked.
Loooking into the details
The windows VARIANT is not cleaned up after the result is copied into a QVARIANT
This fixes it
It is hard for me to provide a small example, as it interacts with out "old"software and a new application on top of that. But I can simply reason about this bug by looking at the provided patch.
Does a deep copy from a VARIANT (ret) to a QVARIANT.
And the variable ret is never used afterwards not is it cleared.
Looking at the MS documentation https://msdn.microsoft.com/en-us/library/windows/desktop/ms221165%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
Or this Article http://www.roblocher.com/whitepapers/oletypes.html
If the VARIANT contains an array/List/pointer to something then it needs to be freed by hand.
Which is clearly not the case.
And as ret is nowhere used anymore we can call clearVARIANT( &ret ) in any case
I really hope this helps to see the issue and the proposed patch. However I still try to think about a easy way for you to reproduce this.