Skip to content

Commit

Permalink
Fix R2 access violations
Browse files Browse the repository at this point in the history
  • Loading branch information
Grahame Grieve committed Feb 29, 2024
1 parent 1a52b30 commit b5d271e
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion library/fhir2/fhir2_factory.pas
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function TFHIRFactoryR2.buildOperationOutcome(i18n: TI18nSupport; langList: THTT
finally
iss.free;
end;
op.link;
result := op.link;
finally
op.free;
end;
Expand Down
2 changes: 1 addition & 1 deletion library/fhir3/fhir3_factory.pas
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function TFHIRFactoryR3.buildOperationOutcome(i18n: TI18nSupport; langList: THTT
finally
iss.free;
end;
op.link;
result := op.link;
finally
op.free;
end;
Expand Down
2 changes: 1 addition & 1 deletion library/fhir4b/fhir4b_factory.pas
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function TFHIRFactoryR4B.buildOperationOutcome(i18n: TI18nSupport; langList: THT
finally
iss.free;
end;
op.link;
result := op.link;
finally
op.free;
end;
Expand Down
2 changes: 1 addition & 1 deletion library/fhir5/fhir5_factory.pas
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ function TFHIRFactoryR5.buildOperationOutcome(i18n: TI18nSupport; langList: THTT
finally
iss.free;
end;
op.link;
result := op.link;
finally
op.free;
end;
Expand Down
2 changes: 1 addition & 1 deletion library/fsl/fsl_base.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ procedure handleObjectTrackingFail(msg : String);
f : System.text;
begin
// Application is pretty much cactus at this point, so we don't mind doing
// slow file operation inside such a system critical lock as GLock
// a slow file operation inside such a system critical lock as GLock

try
fn := 'c:\temp\object-tracking-errors.log';
Expand Down
6 changes: 4 additions & 2 deletions library/ftx/fhir_codesystem_service.pas
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,15 @@ constructor TFHIRCodeSystemEntry.Create(res : TFHIRResourceProxyV);
begin
inherited Create;
FCodeSystemProxy := res;
FLoadingState := cseNotLoaded;
end;

constructor TFHIRCodeSystemEntry.Create(res: TFHIRCodeSystemW);
begin
inherited Create;
FCodeSystem := res;
LoadCodeSystem;
FLoadingState := cseNotLoaded;
FLoadingState := cseLoaded;
end;

destructor TFHIRCodeSystemEntry.Destroy;
Expand Down Expand Up @@ -451,7 +452,8 @@ procedure TFHIRCodeSystemEntry.SetCodeSystem(const Value: TFHIRCodeSystemW);
begin
FCodeSystem.free;
FCodeSystem := value;
LoadCodeSystem;
if FCodeSystem <> nil then
LoadCodeSystem;
end;

function TFHIRCodeSystemEntry.GetUrl: String;
Expand Down
4 changes: 2 additions & 2 deletions library/ftx/fhir_valuesets.pas
Original file line number Diff line number Diff line change
Expand Up @@ -3226,7 +3226,7 @@ function TFHIRValueSetExpander.processCode(cs : TCodeSystemProvider; parent : TF
exit;


if (cs.expandLimitation > 0) then
if (cs <> nil) and (cs.expandLimitation > 0) then
begin
cnt := FCSCounter[cs.systemUri];
if (cnt = nil) then
Expand Down Expand Up @@ -3345,7 +3345,7 @@ function TFHIRValueSetExpander.processCode(cs : TCodeSystemProvider; parent : TF
end;
end;
end
else if csProps <> nil then
else if (csProps <> nil) and (cs <> nil) then
begin
for cp in csprops do
begin
Expand Down

0 comments on commit b5d271e

Please sign in to comment.