mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibLine: Restore previous state only if initialized
This makes the library safe to construct/destruct without actually using it.
This commit is contained in:
parent
cd1d369cdd
commit
8f08ec5038
Notes:
sideshowbarker
2024-07-19 08:00:18 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/8f08ec5038b Pull-request: https://github.com/SerenityOS/serenity/pull/1571
1 changed files with 2 additions and 1 deletions
|
@ -44,7 +44,8 @@ Editor::Editor()
|
|||
|
||||
Editor::~Editor()
|
||||
{
|
||||
tcsetattr(0, TCSANOW, &m_default_termios);
|
||||
if (m_initialized)
|
||||
tcsetattr(0, TCSANOW, &m_default_termios);
|
||||
}
|
||||
|
||||
void Editor::add_to_history(const String& line)
|
||||
|
|
Loading…
Add table
Reference in a new issue