Mercurial > hg > orthanc-stone
diff Framework/Viewport/WebAssemblyViewport.cpp @ 1050:d393ad9cf68c
fix
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 10 Oct 2019 14:31:56 +0200 |
parents | 6a9300ecfa13 |
children | 3c9529edf5fd |
line wrap: on
line diff
--- a/Framework/Viewport/WebAssemblyViewport.cpp Thu Oct 10 14:29:02 2019 +0200 +++ b/Framework/Viewport/WebAssemblyViewport.cpp Thu Oct 10 14:31:56 2019 +0200 @@ -20,6 +20,9 @@ #include "WebAssemblyViewport.h" + +#include "../StoneException.h" + #include <emscripten/html5.h> namespace OrthancStone @@ -110,11 +113,18 @@ GetCompositor()->Refresh(); } } - catch (const OpenGLContextLostException& e) + catch (const StoneException& e) { - LOG(WARNING) << "Context " << std::hex << e.context_ << " is lost! Compositor will be disabled."; - DisableCompositor(); - // we now need to wait for the "context restored" callback + if (e.GetErrorCode() == ErrorCode_WebGLContextLost) + { + LOG(WARNING) << "Context is lost! Compositor will be disabled."; + DisableCompositor(); + // we now need to wait for the "context restored" callback + } + else + { + throw; + } } catch (...) {