Skip to content

Commit

Permalink
Cached Pixmap Crash Fix (#75)
Browse files Browse the repository at this point in the history
Make the invalid/default/null pixmap returned by the pixmap cache static so that it is safe to return  when no pixmap is found.
  • Loading branch information
RobertBColton authored Jun 25, 2019
1 parent 854ab41 commit 78adb67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Components/ArtManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const QIcon& ArtManager::GetIcon(const QString& name) {
const QBrush& ArtManager::GetTransparenyBrush() { return transparenyBrush; }

const QPixmap& ArtManager::GetCachedPixmap(const QString& name) {
QPixmap pm;
static QPixmap pm;
if (!QPixmapCache::find(name, &pm)) {
pm.load(name);
QPixmapCache::insert(name, pm);
Expand Down

0 comments on commit 78adb67

Please sign in to comment.