Correct "easy access" proxy implementation not to free result property.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1252 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2010-07-14 18:04:43 +00:00
parent 5c0465c60c
commit c75480148f

View File

@ -827,14 +827,15 @@ Var
if origineIsFunc then begin if origineIsFunc then begin
Indent(); WriteLn('%s := %s(%s);',[sOUTPUT_PARAM,origineMthd.Name,sINPUT_PARAM]); Indent(); WriteLn('%s := %s(%s);',[sOUTPUT_PARAM,origineMthd.Name,sINPUT_PARAM]);
if localIsFunc then begin if localIsFunc then begin
Indent(); WriteLn('if ( %s <> nil ) then',[sOUTPUT_PARAM]); Indent(); WriteLn('if ( %s <> nil ) then begin',[sOUTPUT_PARAM]);
IncIndent(); IncIndent();
Indent(); WriteLn('Result := %s.%s',[sOUTPUT_PARAM,origineResProp.Name]); Indent(); WriteLn('Result := %s.%s;',[sOUTPUT_PARAM,origineResProp.Name]);
Indent(); WriteLn('%s.%s := nil;',[sOUTPUT_PARAM,origineResProp.Name]);
DecIndent(); DecIndent();
elt := origineResProp.VarType; elt := origineResProp.VarType;
if elt.InheritsFrom(TPasUnresolvedTypeRef) then if elt.InheritsFrom(TPasUnresolvedTypeRef) then
elt := SymbolTable.FindElement(SymbolTable.GetExternalName(elt)); elt := SymbolTable.FindElement(SymbolTable.GetExternalName(elt));
Indent(); WriteLn('else'); Indent(); WriteLn('end else begin');
IncIndent(); IncIndent();
if elt.InheritsFrom(TPasUnresolvedTypeRef) then begin if elt.InheritsFrom(TPasUnresolvedTypeRef) then begin
Indent(); WriteLn('FillChar(Result,SizeOf(Result),#0);'); Indent(); WriteLn('FillChar(Result,SizeOf(Result),#0);');
@ -848,6 +849,7 @@ Var
end; end;
end; end;
DecIndent(); DecIndent();
Indent(); WriteLn('end;');
end; end;
end else begin end else begin
Indent(); WriteLn('%s(%s);',[origineMthd.Name,sINPUT_PARAM]); Indent(); WriteLn('%s(%s);',[origineMthd.Name,sINPUT_PARAM]);