Skip to content

Commit

Permalink
Fix #4459: Rare crash when opening Texture Tool
Browse files Browse the repository at this point in the history
Due to stale references of previously selected objects
  • Loading branch information
codereader committed Jan 2, 2017
1 parent ee886ba commit b62e6d0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions radiant/textool/TexTool.cpp
Expand Up @@ -129,6 +129,10 @@ void TexTool::_preHide()

GlobalUndoSystem().removeObserver(this);
GlobalSelectionSystem().removeObserver(this);

// Clear items to prevent us from running into stale references
// when the textool is shown again
_items.clear();
}

// Pre-show callback
Expand Down Expand Up @@ -716,6 +720,11 @@ void TexTool::drawGrid() {

void TexTool::onGLDraw()
{
if (_updateNeeded)
{
return; // stop here, wait for the next idle event to refresh
}

// Initialise the viewport
glViewport(0, 0, _windowDims[0], _windowDims[1]);
glMatrixMode(GL_PROJECTION);
Expand Down

0 comments on commit b62e6d0

Please sign in to comment.