]> git.sesse.net Git - casparcg/blobdiff - common/diagnostics/graph.cpp
* Created custom decklink allocator for reducing memory footprint.
[casparcg] / common / diagnostics / graph.cpp
index 542008e3bc33fe3420a29428f4a958ae43dc30ed..3c7da27c3fc7512b5291c837b75b4bd7b52b0ee5 100644 (file)
@@ -140,10 +140,23 @@ private:
                                return;\r
                        }\r
                }               \r
-               glClear(GL_COLOR_BUFFER_BIT);\r
-               window_->Draw(*this);\r
-               window_->Display();\r
-               boost::this_thread::sleep(boost::posix_time::milliseconds(10));\r
+\r
+               try\r
+               {\r
+                       glClear(GL_COLOR_BUFFER_BIT);\r
+                       window_->Draw(*this);\r
+                       window_->Display();\r
+                       boost::this_thread::sleep(boost::posix_time::milliseconds(10));\r
+               }\r
+               catch (...)\r
+               {\r
+                       CASPAR_LOG_CURRENT_EXCEPTION();\r
+                       CASPAR_LOG(error)\r
+                                       << L"Closing diag window due to error during rendering";\r
+                       window_.reset();\r
+                       return;\r
+               }\r
+\r
                executor_.begin_invoke([this]{tick();});\r
        }\r
 \r