Commit 3abd27c6 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

oleaut32: Fix VARIANT_UserFree.

parent 2898b5d9
...@@ -646,24 +646,27 @@ void WINAPI VARIANT_UserFree(unsigned long *pFlags, VARIANT *pvar) ...@@ -646,24 +646,27 @@ void WINAPI VARIANT_UserFree(unsigned long *pFlags, VARIANT *pvar)
VariantClear(pvar); VariantClear(pvar);
if (!ref) return; if (!ref) return;
switch (vt) { if(vt & VT_ARRAY)
LPSAFEARRAY_UserFree(pFlags, V_ARRAYREF(pvar));
else
{
switch (vt)
{
case VT_BSTR | VT_BYREF: case VT_BSTR | VT_BYREF:
BSTR_UserFree(pFlags, ref); BSTR_UserFree(pFlags, V_BSTRREF(pvar));
break; break;
case VT_VARIANT | VT_BYREF: case VT_VARIANT | VT_BYREF:
VARIANT_UserFree(pFlags, ref); VARIANT_UserFree(pFlags, V_VARIANTREF(pvar));
break; break;
case VT_RECORD | VT_BYREF: case VT_RECORD | VT_BYREF:
FIXME("handle BRECORD by ref\n"); FIXME("handle BRECORD by ref\n");
break; break;
case VT_UNKNOWN: case VT_UNKNOWN | VT_BYREF:
case VT_DISPATCH: case VT_DISPATCH | VT_BYREF:
IUnknown_Release(V_UNKNOWN(pvar)); IUnknown_Release(*V_UNKNOWNREF(pvar));
break;
default:
FIXME("handle unknown complex type\n");
break; break;
} }
}
CoTaskMemFree(ref); CoTaskMemFree(ref);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment