Explorar el Código

Properly clean up PlayerRenderer in OpenGL init error case

We delete the m_renderer instance, but don't set it to 0. The dangling
pointer could in theory be accessed in other places. In particular,
"emit onFatalError()" is asynchronous (queued connection), and won't
bail out immediately.
Vincent Lang hace 9 años
padre
commit
ce51bcfcad
Se han modificado 1 ficheros con 1 adiciones y 0 borrados
  1. 1 0
      src/player/PlayerQuickItem.cpp

+ 1 - 0
src/player/PlayerQuickItem.cpp

@@ -206,6 +206,7 @@ void PlayerQuickItem::onSynchronize()
     if (!m_renderer->init())
     {
       delete m_renderer;
+      m_renderer = NULL;
       emit onFatalError(tr("Could not initialize OpenGL."));
       return;
     }