Am Donnerstag, den 01.01.2009, 18:58 +0000 schrieb Rob Shearman:
2009/1/1 Michael Karcher <wine(a)mkarcher.dialup.fu-berlin.de>:
+ hr = IPropertyBag_RemoteRead_Proxy(This, pszPropName, &outVariant, pErrorLog, + V_VT(pVar), pUnk); + if(SUCCEEDED(hr)) + hr = VariantCopy(pVar, &outVariant); + + return hr;
You're leaking the memory in outVariant here, since VariantCopy does a deep copy of all of the data. Is there a reason you don't just pass pVar into IPropertyBag_RemoteRead_Proxy? Yes. I want outVariant to be unmodified in the case of error. But that might be wrong. Even if I pass pVar into IPropertyBag_RemoteRead_Proxy, i have to take care of leaking, I think, as RemoteRead takes the variant pointer as an out-only parameter, so I would have to VariantClear outVariant before. But you are right that this might be the better solution.
Thanks for reviewing my patches. Regards, Michael Karcher