Release the graphics device when quitting.