X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f239af65af594968e2fe6885e389a5bd28d73d9d..1af67319a7c54373c85a15477f59a72f3e929268:/src/msw/ole/automtn.cpp?ds=inline diff --git a/src/msw/ole/automtn.cpp b/src/msw/ole/automtn.cpp index 9c3600dd12..369dfec16f 100644 --- a/src/msw/ole/automtn.cpp +++ b/src/msw/ole/automtn.cpp @@ -222,6 +222,12 @@ bool wxAutomationObject::Invoke(const wxString& member, int action, { vReturn.pdispVal = NULL; } + // Mustn't free the SAFEARRAY if it is contained in the retValue + if ((vReturn.vt & VT_ARRAY) && + retValue.GetType() == wxS("safearray")) + { + vReturn.parray = NULL; + } } } return true;