Fix AV with xml

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1259 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
inoussa
2010-07-19 10:44:34 +00:00
parent 41db3ae6da
commit a37f60260f
3 changed files with 11 additions and 3 deletions

View File

@ -111,6 +111,7 @@ type
TScopedArrayStackItem = class(TAbstractArrayStackItem)
protected
destructor Destroy();override;
function CreateList(const ANodeName : string):TDOMNodeList;override;
end;
@ -2371,6 +2372,13 @@ end;
{ TScopedArrayStackItem }
destructor TScopedArrayStackItem.Destroy();
begin
if ( FItemList <> nil ) then
FItemList := nil;
inherited Destroy();
end;
function TScopedArrayStackItem.CreateList(const ANodeName : string): TDOMNodeList;
begin
if ScopeObject.HasChildNodes() then begin

View File

@ -80,9 +80,9 @@ end;
procedure ReleaseDomNode(ADomNode : TDOMNodeList);overload;
begin
{$IFNDEF TDOMNodeList_RELEASE_NOT_FREE}
{ $IFNDEF TDOMNodeList_RELEASE_NOT_FREE}
ADomNode.Free();
{$ENDIF}
{ $ENDIF}
end;
procedure ReleaseDomNode(ADomNode : TDOMNamedNodeMap);overload;

View File

@ -175,7 +175,7 @@ implementation
begin
Result := nil;
if ( ANode <> nil ) and ANode.HasChildNodes() then begin
Result := TDOMNodeListCursor.Create(ANode.ChildNodes,faFreeOnDestroy) ;
Result := TDOMNodeListCursor.Create(ANode.ChildNodes,faNone) ;
if ( AExposedType = cetRttiNode ) then
Result := TDOMNodeRttiExposerCursor.Create(Result);
end;