summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 31d174a)
raw | patch | inline | side by side (parent: 31d174a)
author | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Mon, 11 Sep 2017 19:14:24 +0000 (22:14 +0300) | ||
committer | Ketmar Dark <ketmar@ketmar.no-ip.org> | |
Mon, 11 Sep 2017 19:31:25 +0000 (22:31 +0300) |
src/shared/xdynrec.pas | patch | blob | history |
diff --git a/src/shared/xdynrec.pas b/src/shared/xdynrec.pas
index 4afab5f2a2f5b31812bc36b9fbaaf5a53590bbc6..37c37aa1cf00f19b57c4912c4e72a9a56e005c53 100644 (file)
--- a/src/shared/xdynrec.pas
+++ b/src/shared/xdynrec.pas
procedure linkNames (rec: TDynRecord);
var
fld: TDynField;
- rt: TDynRecord;
+ rt, rvc: TDynRecord;
begin
+ if (rec = nil) then exit;
//writeln('*** rec: ', rec.mName, '.', rec.mId, ' (', rec.mFields.count, ')');
for fld in rec.mFields do
begin
+ if (fld.mType = TDynField.TType.TList) then
+ begin
+ for rvc in fld.mRVal do linkNames(rvc);
+ end;
if (fld.mType = TDynField.TType.TTrigData) then
begin
- if (fld.mRecRef <> nil) then linkNames(fld.mRecRef);
+ //if (fld.mRecRef <> nil) then linkNames(fld.mRecRef);
continue;
end;
if (Length(fld.mRecRefId) = 0) then continue;
for fld in rec.mFields do
begin
//writeln(' ', fld.mName);
- fld.fixDefaultValue(); // just in case
+ fld.fixDefaultValue();
end;
end;
if mHeader then
begin
// link fields
- for fld in mFields do
- begin
- if (fld.mType <> TDynField.TType.TList) then continue;
- for rec in fld.mRVal do linkNames(rec);
- end;
+ linkNames(self);
+ for rec in mRec2Free do if (rec <> nil) then linkNames(rec);
end;
-
- // fix field defaults
- {$IF DEFINED(D2D_DYNREC_PROFILER)}stt := getTimeMicro();{$ENDIF}
- for fld in mFields do fld.fixDefaultValue();
- {$IF DEFINED(D2D_DYNREC_PROFILER)}profFixDefaults := getTimeMicro()-stt;{$ENDIF}
//writeln('done parsing record <', mName, '>');
//{$IF DEFINED(D2D_DYNREC_PROFILER)}writeln('stall: ', getTimeMicro()-stall);{$ENDIF}
{$IF DEFINED(D2D_DYNREC_PROFILER)}profRecValParse := getTimeMicro()-stall;{$ENDIF}