Browse Source

Revert "Fail gracefully if APP->window->loadFont()/loadImage() is called from a ModuleWidget constructor when Window is null."

This reverts commit 9dcb2e66bf.
tags/v2.0.3
Andrew Belt 3 years ago
parent
commit
871d471de1
1 changed files with 0 additions and 8 deletions
  1. +0
    -8
      src/window/Window.cpp

+ 0
- 8
src/window/Window.cpp View File

@@ -709,10 +709,6 @@ double Window::getFrameDurationRemaining() {


std::shared_ptr<Font> Window::loadFont(const std::string& filename) {
// HACK If ModuleWidgets call loadFont() in their constructor, APP->window might be null.
if (!this)
return NULL;

const auto& pair = internal->fontCache.find(filename);
if (pair != internal->fontCache.end())
return pair->second;
@@ -733,10 +729,6 @@ std::shared_ptr<Font> Window::loadFont(const std::string& filename) {


std::shared_ptr<Image> Window::loadImage(const std::string& filename) {
// HACK If ModuleWidgets call loadFont() in their constructor, APP->window might be null.
if (!this)
return NULL;

const auto& pair = internal->imageCache.find(filename);
if (pair != internal->imageCache.end())
return pair->second;


Loading…
Cancel
Save