fixed a leak with GL shutdown