Преглед изворни кода

LibLine: Actually remove the two levels of deferred_invoke

4d5cdcc89394259019828f123039104d6f4039e2 partially reverted the changes
from d8c5eeceabbeaedc29823f12cc8a9cfac6f84686, but it reverted too much
and reintroduced the bug.
This commit finally fixes the actual bug.
The author hasn't been in his best committing state today.
Ali Mohammad Pur пре 4 година
родитељ
комит
7700ee2722
1 измењених фајлова са 4 додато и 9 уклоњено
  1. 4 9
      Userland/Libraries/LibLine/Editor.cpp

+ 4 - 9
Userland/Libraries/LibLine/Editor.cpp

@@ -588,10 +588,8 @@ void Editor::interrupted()
     m_is_editing = false;
     restore();
     m_notifier->set_enabled(false);
-    deferred_invoke([this](auto&) {
-        m_notifier = nullptr;
-        Core::EventLoop::current().quit(Retry);
-    });
+    m_notifier = nullptr;
+    Core::EventLoop::current().quit(Retry);
 }
 
 void Editor::resized()
@@ -623,12 +621,9 @@ void Editor::really_quit_event_loop()
         restore();
 
     m_returned_line = string;
-
     m_notifier->set_enabled(false);
-    deferred_invoke([this](auto&) {
-        m_notifier = nullptr;
-        Core::EventLoop::current().quit(Exit);
-    });
+    m_notifier = nullptr;
+    Core::EventLoop::current().quit(Exit);
 }
 
 auto Editor::get_line(const String& prompt) -> Result<String, Editor::Error>