Fix RTImage cached data cleanup (see #3636)

This commit is contained in:
Hombre
2019-03-24 20:45:05 +01:00
parent b9a5680d1d
commit 29196fb57c
3 changed files with 17 additions and 1 deletions

View File

@@ -120,6 +120,10 @@ void RTImage::changeImage (const Glib::ustring& imageName)
{
clear ();
if (imageName.empty()) {
return;
}
if (pixbuf) {
auto iterator = pixbufCache.find (imageName);
assert(iterator != pixbufCache.end ());
@@ -169,6 +173,17 @@ void RTImage::init()
scaleBack = RTScalable::getScale();
}
void RTImage::cleanup()
{
for (auto& entry : pixbufCache) {
entry.second.reset();
}
for (auto& entry : surfaceCache) {
entry.second.clear();
}
RTScalable::cleanup();
}
void RTImage::updateImages()
{
for (auto& entry : pixbufCache) {