fix, TCECustimWritableComponent, prop hasLoaded could be erroneously set to true

This commit is contained in:
Basile Burg 2015-08-24 14:48:36 +02:00
parent 104d6bc3b6
commit 9cca5e1b12
1 changed files with 12 additions and 2 deletions

View File

@ -107,11 +107,21 @@ begin
end;
procedure TCustomWritableComponent.loadFromFile(const aFilename: string);
var
err: boolean;
begin
fHasLoaded := true;
err := false;
fHasLoaded := false;
beforeLoad;
setFilename(aFilename);
customLoadFromFile(aFilename);
try
customLoadFromFile(aFilename);
except
err := true;
fHasLoaded := false;
end;
if not err then
fHasLoaded := true;
afterLoad;
end;
{$ENDREGION}