Skip to content

Commit

Permalink
dialogs/TextInputDialog: call CommitHistory() only when dialog is con…
Browse files Browse the repository at this point in the history
…firmed

Fixes crash bug when CommitHistory() is called after Cancel() has
already called history->pop_back().
  • Loading branch information
MaxKellermann committed Sep 23, 2024
1 parent 3bc9545 commit 36a14eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ncmpc 0.51 - not yet released
* repaint main area after terminal was resized
* pressing Enter while in "jump mode" activates selected item
* fix crash in new text input dialog

ncmpc 0.50 - (2024-09-12)
* build: require Meson 0.60
Expand Down
3 changes: 1 addition & 2 deletions src/dialogs/TextInputDialog.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ TextInputDialog::SetReady() noexcept
assert(!ready);
ready = true;

CommitHistory();

if (continuation)
continuation.resume();
}
Expand Down Expand Up @@ -237,6 +235,7 @@ TextInputDialog::OnKey(const Window window, int key)
return false;
}

CommitHistory();
SetReady();
return true;
}
Expand Down

0 comments on commit 36a14eb

Please sign in to comment.