Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix crash when re-importing the same resource, but changed

Dmitry Kazakovb18e25c5b9ec
diff --git a/libs/resources/KisResourceLocator.cpp b/libs/resources/KisResourceLocator.cpp
index 0437132737..c1629381e6 100644
--- a/libs/resources/KisResourceLocator.cpp
+++ b/libs/resources/KisResourceLocator.cpp
@@ -525,6 +525,11 @@ KoResourceSP KisResourceLocator::importResource(const QString &resourceType, con
// remove everything related to this resource from the database (remember about tags and versions!!!)
r = KisResourceCacheDb::removeResourceCompletely(existingResourceId);
+ {
+ const QString absoluteStorageLocation = makeStorageLocationAbsolute(resource->storageLocation());
+ KisResourceThumbnailCache::instance()->remove(absoluteStorageLocation, resourceType, existingResource->filename());
+ }
+
Q_EMIT endExternalResourceRemove(resourceType);
if (!r) {