Permalink
Browse files

Check if view is in list before trying to remove it

  • Loading branch information...
1 parent c5ed15e commit bdbcc22edd8d6126d248a8321abc121a82b7bb63 @Gvourr Gvourr committed Feb 8, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 GoodCitizenCascades/src/OpenGLThread.cpp
@@ -142,8 +142,11 @@ void OpenGLThread::addView(OpenGLView *view) {
void OpenGLThread::removeView(OpenGLView *view) {
if (view != NULL) {
m_viewsMutex.lock();
+ int index = m_views.indexOf(view);
- m_views.remove(m_views.indexOf(view));
+ if ( index != -1 ) {
+ m_views.remove(index);
+ }
m_viewsMutex.unlock();

0 comments on commit bdbcc22

Please sign in to comment.