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