Fix RTImage cached data cleanup (see #3636)
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user