diff Framework/Scene2D/OpenGLCompositor.cpp @ 1327:4f8db2d202c8 broker

OrthancSeriesProgressiveLoader now has two modes that can be selected at object creation : - progressive (will first load jpeg50, then jpeg90 then PAM) - non-progressive (will directly load PAM (uncompressed)) Please note that the slice loading order remains dynamic and depending upon the slice that the client code wishes to extract from the volume.
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 25 Mar 2020 14:34:27 +0100
parents 257f2c9a02ac
children 28c64c246312
line wrap: on
line diff
--- a/Framework/Scene2D/OpenGLCompositor.cpp	Tue Mar 24 21:32:35 2020 +0100
+++ b/Framework/Scene2D/OpenGLCompositor.cpp	Wed Mar 25 14:34:27 2020 +0100
@@ -13,7 +13,7 @@
  * WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Affero General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Affero General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  **/
@@ -150,11 +150,34 @@
   {
     if (!context_.IsContextLost())
     {
-      context_.MakeCurrent(); // this can throw if context lost!
-      for (Fonts::iterator it = fonts_.begin(); it != fonts_.end(); ++it)
+      try
       {
-        assert(it->second != NULL);
-        delete it->second;
+        try
+        {
+          context_.MakeCurrent(); // this can throw if context lost!
+        }
+        catch (...)
+        {
+          LOG(ERROR) << "context_.MakeCurrent() failed in OpenGLCompositor::~OpenGLCompositor()!";
+        }
+
+        for (Fonts::iterator it = fonts_.begin(); it != fonts_.end(); ++it)
+        {
+          try
+          {
+
+            assert(it->second != NULL);
+            delete it->second;
+          }
+          catch (...)
+          {
+            LOG(ERROR) << "Exception thrown while deleting OpenGL-based font!";
+          }
+        }
+      }
+      catch (...)
+      {
+        // logging threw an exception!
       }
     }
   }