Skip to content

Commit

Permalink
TOcrivistEdit: procedure Clear now frees FOCRData
Browse files Browse the repository at this point in the history
  • Loading branch information
malcolmgp committed May 11, 2014
1 parent 77ca96e commit e6c9962
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion OcrivistData.pas
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,7 @@ destructor TOcrivistPage.Destroy;
var
c: Integer;
begin
if Assigned(FOCRData) then FOCRData.Free;
// if Assigned(FOCRData) then FOCRData.Free; //This is now done in TOcrivistEdit.Clear;
if Assigned(FThumbnail) then FThumbnail.Free;
inherited Destroy;
end;
Expand Down
8 changes: 8 additions & 0 deletions ocreditor.pas
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ TOcrivistEdit = class( TSynMemo )
procedure MergeLeft;
procedure MergeRight;
procedure Spellcheck;
procedure Clear;
procedure HighlightToken( aline, aword: Integer );
property OCRData: TTesseractPage read FOCRData write SetOCRData;
property Text: string read GetText;
Expand Down Expand Up @@ -413,6 +414,13 @@ procedure TOcrivistEdit.Spellcheck;
end;
end;

procedure TOcrivistEdit.Clear;
begin
inherited Clear;
FOCRData.Free;
FOCRData := nil;
end;

procedure TOcrivistEdit.HighlightToken ( aline, aword: Integer ) ;
var
charoffset: Integer;
Expand Down

0 comments on commit e6c9962

Please sign in to comment.