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

This commit is contained in:
Andreas Kling 2019-07-22 20:12:35 +02:00
commit b312215d33
Notes: sideshowbarker 2024-07-19 13:05:22 +09:00

View file

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