summaryrefslogtreecommitdiff
path: root/wx+/image_resources.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2016-03-16 21:32:07 +0100
committerDaniel Wilhelm <daniel@wili.li>2016-03-16 21:32:07 +0100
commitce3574cf7ff2ee68608b4d001f5a6dd1e36b2252 (patch)
tree576b1741351e1cd34f0fcce49f98df9c17e10912 /wx+/image_resources.cpp
parent7.6 (diff)
downloadFreeFileSync-ce3574cf7ff2ee68608b4d001f5a6dd1e36b2252.tar.gz
FreeFileSync-ce3574cf7ff2ee68608b4d001f5a6dd1e36b2252.tar.bz2
FreeFileSync-ce3574cf7ff2ee68608b4d001f5a6dd1e36b2252.zip
7.7
Diffstat (limited to 'wx+/image_resources.cpp')
-rw-r--r--wx+/image_resources.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/wx+/image_resources.cpp b/wx+/image_resources.cpp
index 98cdc7a8..4ba62bb9 100644
--- a/wx+/image_resources.cpp
+++ b/wx+/image_resources.cpp
@@ -50,12 +50,18 @@ public:
}
void init(const Zstring& filepath);
+ void cleanup()
+ {
+ bitmaps.clear();
+ anims.clear();
+ }
const wxBitmap& getImage (const wxString& name) const;
const wxAnimation& getAnimation(const wxString& name) const;
private:
GlobalResources() {}
+ ~GlobalResources() { assert(bitmaps.empty() && anims.empty()); } //don't leave wxWidgets objects for static destruction!
GlobalResources (const GlobalResources&) = delete;
GlobalResources& operator=(const GlobalResources&) = delete;
@@ -127,6 +133,7 @@ const wxAnimation& GlobalResources::getAnimation(const wxString& name) const
void zen::initResourceImages(const Zstring& filepath) { GlobalResources::instance().init(filepath); }
+void zen::cleanupResourceImages() { GlobalResources::instance().cleanup(); }
const wxBitmap& zen::getResourceImage(const wxString& name) { return GlobalResources::instance().getImage(name); }
bgstack15