Skip to content

Commit

Permalink
#5420: Fix crash at startup when the "load last map" setting is active
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Nov 18, 2020
1 parent 57dec3e commit 899573a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/version.h
Expand Up @@ -2,7 +2,7 @@
#include <config.h>
#define RADIANT_VERSION PACKAGE_VERSION
#else
#define RADIANT_VERSION "2.9.0"
#define RADIANT_VERSION "2.9.1"
#endif

#define RADIANT_APPNAME "DarkRadiant"
Expand Down
2 changes: 1 addition & 1 deletion radiant/render/OpenGLModule.cpp
Expand Up @@ -38,7 +38,7 @@ void OpenGLModule::drawChar(char character) const

int OpenGLModule::getFontHeight()
{
return _font->getPixelHeight();
return _font ? _font->getPixelHeight() : 0;
}

const std::string& OpenGLModule::getName() const
Expand Down
8 changes: 6 additions & 2 deletions radiant/ui/texturebrowser/TextureBrowser.cpp
Expand Up @@ -602,13 +602,17 @@ void TextureBrowser::queueUpdate()

void TextureBrowser::performUpdate()
{
// During startup the openGL module might not have created the font yet
if (!GlobalMaterialManager().isRealised() || GlobalOpenGL().getFontHeight() == 0)
{
return;
}

_updateNeeded = false;

// Update all renderable items
_tiles.clear();

if (!GlobalMaterialManager().isRealised()) return;

CurrentPosition layout;
_entireSpaceHeight = 0;

Expand Down

0 comments on commit 899573a

Please sign in to comment.