Fix T56695: Selecting an occluded object in xray causes crash
[blender.git] / source / blender / editors / space_view3d / view3d_view.c
index c65c3f16d6d98a340e7b541c5e5acf869ab2489e..68e9053101e7a94a595a064b9dfda7afd7ffc2b0 100644 (file)
@@ -1027,6 +1027,9 @@ int view3d_opengl_select(
                        drw_select_loop_pass, &drw_select_loop_user_data,
                        object_filter.fn, object_filter.user_data);
                hits = drw_select_loop_user_data.hits;
+               /* FIX: This cleanup the state before doing another selection pass.
+                * (see T56695) */
+               GPU_select_cache_end();
        }
 
        if (hits == 0) {