Merging OCC22105, OCC22354, OCC22150 , OCC22199 , OCC22391 and OCC22108
[occt.git] / src / OpenGl / OpenGl_togl_redraw.cxx
index ea1caaa..0b52495 100755 (executable)
@@ -59,6 +59,7 @@ GLboolean g_fBitmap;
 #include <OpenGl_tgl_funcs.hxx>
 #include <OpenGl_tgl_subrvis.hxx>
 #include <OpenGl_FrameBuffer.hxx>
 #include <OpenGl_tgl_funcs.hxx>
 #include <OpenGl_tgl_subrvis.hxx>
 #include <OpenGl_FrameBuffer.hxx>
+#include <OpenGl_ResourceCleaner.hxx>
 #include <InterfaceGraphic_Graphic3d.hxx>
 #include <InterfaceGraphic_Visual3d.hxx>
 
 #include <InterfaceGraphic_Graphic3d.hxx>
 #include <InterfaceGraphic_Visual3d.hxx>
 
@@ -86,9 +87,9 @@ call_togl_redraw
       aFrameBuffer->BindBuffer();
       swap = 0; // no need to swap buffers
     }
       aFrameBuffer->BindBuffer();
       swap = 0; // no need to swap buffers
     }
-
+    OpenGl_ResourceCleaner::GetInstance()->Cleanup();
     call_func_redraw_all_structs_begin (aview->WsId);
     call_func_redraw_all_structs_begin (aview->WsId);
-    call_togl_setplane( aview ); /* apl - OCC22108: update clipping planes */
+    call_togl_setplane( aview );
     if (anunderlayer->ptrLayer)
     {
       call_togl_redraw_layer2d (aview, anunderlayer);
     if (anunderlayer->ptrLayer)
     {
       call_togl_redraw_layer2d (aview, anunderlayer);
@@ -163,8 +164,9 @@ call_togl_redraw_area
       glScissor ((GLint )x,
                  (GLint )((int )aview->DefWindow.dy - (y + height)),
                  (GLsizei )width, (GLsizei )height);
       glScissor ((GLint )x,
                  (GLint )((int )aview->DefWindow.dy - (y + height)),
                  (GLsizei )width, (GLsizei )height);
+      OpenGl_ResourceCleaner::GetInstance()->Cleanup();
       call_func_redraw_all_structs_begin (aview->WsId);
       call_func_redraw_all_structs_begin (aview->WsId);
-      call_togl_setplane( aview ); /* apl - OCC22108: update clipping planes */
+      call_togl_setplane( aview );
       if (anunderlayer->ptrLayer)
       {
         call_togl_redraw_layer2d (aview, anunderlayer);
       if (anunderlayer->ptrLayer)
       {
         call_togl_redraw_layer2d (aview, anunderlayer);