From c0cc78df590a81b15d8a7eb1590edbec8fec6f1a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 8 Mar 2017 16:30:12 +0300 Subject: Clean global font pointer on gui deletion. --- src/gui/gui.cpp | 1 + src/gui/widgets/widget.h | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src') diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index fd3f8bd2a..06afeccc6 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -294,6 +294,7 @@ Gui::~Gui() delete2(mFocusHandler); Label::finalCleanup(); Tab::finalCleanup(); + Widget::cleanGlobalFont(); } void Gui::logic() diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h index 92b345cea..3601570cb 100644 --- a/src/gui/widgets/widget.h +++ b/src/gui/widgets/widget.h @@ -644,6 +644,9 @@ class Widget notfinal : public Widget2 static Font *getGloablFont() { return mGlobalFont; } + static void cleanGlobalFont() + { mGlobalFont = nullptr; } + /** * Sets the font for the widget. If NULL is passed, the global font * will be used. -- cgit v1.2.3-70-g09d2