mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-06 10:10:39 +02:00
dom.pp: Ignore node read-only property when its owning document is being destroyed (enables destroying nodes in arbitrary order).
git-svn-id: trunk@13175 -
This commit is contained in:
parent
6049600ccb
commit
0a242ba49f
@ -180,7 +180,8 @@ type
|
|||||||
nfRecycled,
|
nfRecycled,
|
||||||
nfLevel2,
|
nfLevel2,
|
||||||
nfIgnorableWS,
|
nfIgnorableWS,
|
||||||
nfSpecified
|
nfSpecified,
|
||||||
|
nfDestroying
|
||||||
);
|
);
|
||||||
TNodeFlags = set of TNodeFlagEnum;
|
TNodeFlags = set of TNodeFlagEnum;
|
||||||
|
|
||||||
@ -1002,7 +1003,7 @@ end;
|
|||||||
|
|
||||||
procedure TDOMNode.Changing;
|
procedure TDOMNode.Changing;
|
||||||
begin
|
begin
|
||||||
if nfReadOnly in FFlags then
|
if (nfReadOnly in FFlags) and not (nfDestroying in FOwnerDocument.FFlags) then
|
||||||
raise EDOMError.Create(NO_MODIFICATION_ALLOWED_ERR, 'Node.CheckReadOnly');
|
raise EDOMError.Create(NO_MODIFICATION_ALLOWED_ERR, 'Node.CheckReadOnly');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1755,6 +1756,7 @@ end;
|
|||||||
|
|
||||||
destructor TDOMDocument.Destroy;
|
destructor TDOMDocument.Destroy;
|
||||||
begin
|
begin
|
||||||
|
Include(FFlags, nfDestroying);
|
||||||
FreeAndNil(FIDList); // set to nil before starting destroying children
|
FreeAndNil(FIDList); // set to nil before starting destroying children
|
||||||
FEmptyNode.Free;
|
FEmptyNode.Free;
|
||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
|
Loading…
Reference in New Issue
Block a user