Skip to content

Commit

Permalink
Merge pull request #7142 from rouault/fix_18996
Browse files Browse the repository at this point in the history
QgsSvgCache::svgAsPicture(): make sure the returned picture is not shared (fixes #18996)
  • Loading branch information
rouault authored Jun 1, 2018
2 parents 9d3f8d4 + 75b7edf commit 2ed200a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/symbology/qgssvgcache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2ed200a

Please sign in to comment.