Bug fix: crash after full screen preview due to dangling pointer

This commit is contained in:
Yuriy Toporovskyy
2021-06-15 18:33:44 -04:00
parent 84492dee48
commit 7d1a12a14f
@@ -1381,6 +1381,10 @@ void EditorViewportWidget::SetViewportId(int id)
{
CViewport::SetViewportId(id);
// Clear the cached debugdisplay pointer. we're about to delete that render viewport, and deleting the render
// viewport invalidates the debugdisplay.
m_debugDisplay = nullptr;
// First delete any existing layout
// This also deletes any existing render viewport widget (since it will be added to the layout)
// Below is the typical method of clearing a QLayout, see e.g. https://doc.qt.io/qt-5/qlayout.html#takeAt