mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +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:
committed by
Andreas Kling
parent
cd1d369cdd
commit
8f08ec5038
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user