Merge pull request #7654 from keymanapp/fix/developer/6928-state-change-for-touch-layout

fix(developer): handle edge cases for app sources
This commit is contained in:
Marc Durdin 2022-11-09 16:45:57 +11:00 • committed by GitHub
commit 8003bf60bd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View file

@ -75,7 +75,11 @@ var
begin
T := FSources.LockList;
try
Assert(T.Count = 0, 'TAppSourceHttpResponder.Sources should be empty at destruction');
// Note: Unlike regular functions, Assert has short-circuit evaluation
// intrinsics on the first param which makes it safe to dereference T[0] in
// the second parameter.
Assert(T.Count = 0, 'TAppSourceHttpResponder.Sources should be empty at destruction '+
'(T.Count='+IntToStr(T.Count)+', T[0].Filename='+T[0].Filename+')');
finally
FSources.UnlockList;
end;

View file

@ -87,7 +87,7 @@ type
procedure UpdateCharacterMap(code: string); // I4046
function GetFontInfo(Index: TKeyboardFont): TKeyboardFontInfo; // I4057
procedure SetFontInfo(Index: TKeyboardFont; const Value: TKeyboardFontInfo); // I4057
procedure cefCommand(Sender: TObject; const command: string; params: TStringList);
procedure cefLoadEnd(Sender: TObject);
procedure RegisterSource;
@ -393,7 +393,7 @@ begin
finally
RegisterSource;
if FState <> '' then
if (FFileName <> '') and (FState <> '') then
modWebHttpServer.AppSource.RegisterSource(FFilename + '#state', FState, True);
end;