Bug on 3D demo

Interesting library.
I tried the demo for 3D display of stl files (for 3D printing) and it works.
When you close the file ... "boom" . Memory access errors ...
I tried debugging and the problem seems to be solved by the change below.


Code:

unit sg3DNavigator;

procedure Tsg3DDrawingNavigator.SetLo***romImage(const Value: TsgCADImage);
begin

  if FLo***romImage <> Value then
  begin
    if Assigned(FLo***romImage) then
    begin
      if Value<> nil then   // change here
        FLo***romImage.OnChange := FLo***romImageChange;
      FLo***romImageChange := nil;
    end;
    FLo***romImage := Value;
    if Assigned(FLo***romImage) then
    begin
      if Value<> nil then   // change here
        FLo***romImageChange := FLo***romImage.OnChange;
      FLo***romImage.OnChange := DoPictureChange;
    end;
    FDrawMode := dmNormal;
  end;
end;


=================
www.downloadly.ir