Skip to content

Commit

Permalink
Fix crash in the specific test case
Browse files Browse the repository at this point in the history
  • Loading branch information
shmuz committed Jan 2, 2025
1 parent 040ff1e commit 2815a6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion far/src/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ bool Manager::ExitAll()
{
Frame *iFrame=ModalStack[i];

if (!iFrame->GetCanLoseFocus(true))
if (!iFrame->GetCanLoseFocus(false))
{
auto PrevFrameCount=ModalStack.size();
iFrame->ProcessKey(KEY_ESC);
Expand Down

1 comment on commit 2815a6d

@shmuz
Copy link
Owner Author

@shmuz shmuz commented on 2815a6d Jan 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test case for this commit:

  1. Run the below code example: a dialog appears on the screen
  2. Press F4: a modal editor is open from the dialog procedure
  3. Either press AltF4 or close Far with mouse by clicking on [x] -- Far crashes
local F = far.Flags
local items = { {F.DI_SINGLEBOX,0,0,24,3, 0,0,0, 0, "title"} }
far.Dialog(nil, -1,-1,24,3, nil,items,nil, function(hDlg,msg,p1,p2)
    if msg==F.DN_KEY and p2==F.KEY_F4 then
      editor.Editor("tmpfile.001")
    end
  end)

Please sign in to comment.