*work in progress*
[winnie] / src / gfx.cc
index 7b3513d..3de2e1d 100644 (file)
@@ -58,7 +58,12 @@ bool init_gfx()
 
 void destroy_gfx()
 {
-       close(dev_fd);
+       clear_screen(0, 0, 0);
+
+       if(dev_fd != -1) {
+               close(dev_fd);
+       }
+
        dev_fd = -1;
 
        munmap(framebuffer, FRAMEBUFFER_SIZE(screen_rect.width, screen_rect.height, color_depth));