mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 13:56:05 +02:00
LCL: Prevent a crash when closing a form with an active in-place cell editor of a grid. Issue #37202.
git-svn-id: trunk@63541 -
This commit is contained in:
parent
c63e4ba86a
commit
1f0ff07dc2
@ -8412,19 +8412,22 @@ var
|
||||
begin
|
||||
if not EditorLocked and (Editor<>nil) and Editor.Visible then
|
||||
begin
|
||||
WasFocused := Editor.Focused;
|
||||
FEditorMode:=False;
|
||||
FEditorMode := False;
|
||||
FGridState := gsNormal;
|
||||
{$ifdef dbgGrid}DebugLnEnter('EditorHide [',Editor.ClassName,'] INIT FCol=',IntToStr(FCol),' FRow=',IntToStr(FRow));{$endif}
|
||||
LockEditor;
|
||||
try
|
||||
DoEditorHide;
|
||||
finally
|
||||
if WasFocused then
|
||||
SetFocus;
|
||||
UnLockEditor;
|
||||
if Editor.Owner<>nil then // May be nil when the form is closing.
|
||||
begin
|
||||
WasFocused := Editor.Focused;
|
||||
{$ifdef dbgGrid}DebugLnEnter('EditorHide [',Editor.ClassName,'] INIT FCol=',IntToStr(FCol),' FRow=',IntToStr(FRow));{$endif}
|
||||
LockEditor;
|
||||
try
|
||||
DoEditorHide;
|
||||
finally
|
||||
if WasFocused then
|
||||
SetFocus;
|
||||
UnLockEditor;
|
||||
end;
|
||||
{$ifdef dbgGrid}DebugLnExit('EditorHide END');{$endif}
|
||||
end;
|
||||
{$ifdef dbgGrid}DebugLnExit('EditorHide END');{$endif}
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user