* when calling GetInterfaceByStr on COM Objects, the refcounter was not increased

* this bugfix fixes bugreport #0012778

git-svn-id: trunk@15073 -
This commit is contained in:
ivost 2010-03-27 11:12:46 +00:00
parent 8cce3d3f91
commit 3f2d66b188

View File

@ -708,6 +708,10 @@
continue search }
Instance := TObject(obj);
until False;
{ Getter function will normally AddRef, so adding another reference here
will cause memleak. com interfaces only!! }
if result and Assigned(IEntry^.IID) and (IEntry^.IType in [etStandard, etFieldValue]) then
IInterface(obj)._AddRef;
end;
function TObject.getinterface(const iidstr : shortstring;out obj) : boolean;