diff --git a/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp b/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp index acd34176a..f780938da 100644 --- a/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp +++ b/lib/irrlicht/source/Irrlicht/CIrrDeviceLinux.cpp @@ -185,15 +185,19 @@ CIrrDeviceLinux::~CIrrDeviceLinux() } #endif // #ifdef _IRR_COMPILE_WITH_OPENGL_ - // Reset fullscreen resolution change - switchToFullscreen(true); - if (SoftwareImage) XDestroyImage(SoftwareImage); if (!ExternalWindow) { XDestroyWindow(display,window); + } + + // Reset fullscreen resolution change + switchToFullscreen(true); + + if (!ExternalWindow) + { XCloseDisplay(display); } }