From 09caa599ff0ae8b9447c898b1e2f3a47b321d59d Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Fri, 5 May 2017 10:38:16 -0700 Subject: [PATCH] avoid an assert when removing a non-existing graphics index in debug mode --- examples/ExampleBrowser/OpenGLGuiHelper.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/ExampleBrowser/OpenGLGuiHelper.cpp b/examples/ExampleBrowser/OpenGLGuiHelper.cpp index b26dfbf59..5c0e995af 100644 --- a/examples/ExampleBrowser/OpenGLGuiHelper.cpp +++ b/examples/ExampleBrowser/OpenGLGuiHelper.cpp @@ -243,7 +243,10 @@ void OpenGLGuiHelper::removeAllGraphicsInstances() void OpenGLGuiHelper::removeGraphicsInstance(int graphicsUid) { - m_data->m_glApp->m_renderer->removeGraphicsInstance(graphicsUid); + if (graphicsUid>=0) + { + m_data->m_glApp->m_renderer->removeGraphicsInstance(graphicsUid); + }; }