Skip to content
Permalink
Browse files

Merge pull request #7142 from rouault/fix_18996

QgsSvgCache::svgAsPicture(): make sure the returned picture is not shared (fixes #18996)
  • Loading branch information
rouault committed Jun 1, 2018
2 parents 9d3f8d4 + 75b7edf commit 2ed200a8f2cf7033256454be368dd253f7ae07e1
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/core/symbology/qgssvgcache.cpp
@@ -182,8 +182,12 @@ QPicture QgsSvgCache::svgAsPicture( const QString &path, double size, const QCol
trimToMaximumSize();
}

QPicture p = *( currentEntry->picture );
p.detach();
QPicture p;
// For some reason p.detach() doesn't seem to always work as intended, at
// least with QT 5.5 on Ubuntu 16.04
// Serialization/deserialization is a safe way to be ensured we don't
// share a copy.
p.setData( currentEntry->picture->data(), currentEntry->picture->size() );
return p;
}

0 comments on commit 2ed200a

Please sign in to comment.
You can’t perform that action at this time.