From 67e266338e76743a81842d4658312b102b700793 Mon Sep 17 00:00:00 2001 From: Aloshi Date: Mon, 26 May 2014 17:52:55 -0500 Subject: [PATCH] Fixed assert being triggered due to divide by zero in HelpComponent::updateGrid due to SVG textures being deinitialized when closing ES with a menu open. --- src/components/ImageComponent.cpp | 2 ++ src/main.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/ImageComponent.cpp b/src/components/ImageComponent.cpp index c8b228e1a..8420d2dc4 100644 --- a/src/components/ImageComponent.cpp +++ b/src/components/ImageComponent.cpp @@ -40,6 +40,8 @@ void ImageComponent::resize() SVGResource* svg = dynamic_cast(mTexture.get()); const Eigen::Vector2f textureSize = svg ? svg->getSourceImageSize() : Eigen::Vector2f((float)mTexture->getSize().x(), (float)mTexture->getSize().y()); + if(textureSize.isZero()) + return; if(mTexture->isTiled()) { diff --git a/src/main.cpp b/src/main.cpp index 06dc8a229..ccd4bfc8f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -272,9 +272,9 @@ int main(int argc, char* argv[]) Log::flush(); } - window.deinit(); while(window.peekGui() != window.getViewController()) delete window.peekGui(); + window.deinit(); SystemData::deleteSystems();