--- Irrlicht.org/CIrrDeviceLinux.cpp 2006-03-21 12:35:33.861331048 +0100 +++ Irrlicht/CIrrDeviceLinux.cpp 2006-03-21 12:32:26.119860361 +0100 @@ -129,14 +129,17 @@ if (doublebuffer) XdbeDeallocateBackBufferName(display, bbuffer); #endif - if (shmem) + if ((DriverType == video::EDT_SOFTWARE)||(DriverType == video::EDT_SOFTWARE2)) { - XShmDetach(display, &shminfo); - XDestroyImage(SoftwareImage); - shmdt(shminfo.shmaddr); + if (shmem) + { + XShmDetach(display, &shminfo); + XDestroyImage(SoftwareImage); + shmdt(shminfo.shmaddr); + } + else + XDestroyImage(SoftwareImage); } - else - XDestroyImage(SoftwareImage); XCloseDisplay(display); } }