Fix #19391: quiting BGE could give drawing errors. Blender now restores
[blender.git] / source / blender / editors / space_view3d / view3d_view.c
index 7831d604ddf040229b157ec70f8dc72114421f7d..b15a7d3c83776843cd12e171079351052f3a19b9 100644 (file)
@@ -1416,8 +1416,6 @@ static void SaveState(bContext *C)
        
        glPushAttrib(GL_ALL_ATTRIB_BITS);
 
-       GPU_state_init();
-
        if(obact && obact->mode & OB_MODE_TEXTURE_PAINT)
                GPU_paint_set_mipmap(1);
        
@@ -1446,6 +1444,8 @@ static void RestoreState(bContext *C)
        
        win->queue= queue_back;
        
+       GPU_state_init();
+
        glPopAttrib();
 }