浏览代码

GDirectoryModel: Don't forget to drain the watch descriptor.

Andreas Kling 6 年之前
父节点
当前提交
b312215d33
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      Libraries/LibGUI/GDirectoryModel.cpp

+ 3 - 0
Libraries/LibGUI/GDirectoryModel.cpp

@@ -319,6 +319,9 @@ void GDirectoryModel::open(const StringView& a_path)
     m_notifier = make<CNotifier>(watch_fd, CNotifier::Event::Read);
     m_notifier->on_ready_to_read = [this] {
         update();
+        char buffer[32];
+        int rc = read(m_notifier->fd(), buffer, sizeof(buffer));
+        ASSERT(rc >= 0);
     };
     update();
     set_selected_index(index(0, 0));