diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceWayland.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceWayland.cpp index 6529a9cc3..64afccf61 100644 --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceWayland.cpp +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceWayland.cpp @@ -1283,7 +1283,10 @@ bool CIrrDeviceWayland::run() { os::Timer::tick(); - wl_display_dispatch_pending(m_display); + if (wl_display_dispatch_pending(m_display) == -1) + { + closeDevice(); + } for (unsigned int i = 0; i < m_events.size(); i++) {