1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

fix crash on exit

This commit is contained in:
krepa098 2015-02-04 09:40:23 +01:00
parent 7321127794
commit 09291bad52
4 changed files with 4 additions and 7 deletions

View File

@ -17,8 +17,6 @@
#include "documentcache.h"
#include "customtextdocument.h"
DocumentCache DocumentCache::instance;
DocumentCache::~DocumentCache()
{
while(!documents.isEmpty())
@ -35,10 +33,12 @@ QTextDocument* DocumentCache::pop()
void DocumentCache::push(QTextDocument *doc)
{
if(doc)
documents.push(doc);
}
DocumentCache &DocumentCache::getInstance()
{
static DocumentCache instance;
return instance;
}

View File

@ -37,7 +37,6 @@ protected:
private:
QStack<QTextDocument*> documents;
static DocumentCache instance;
};
#endif // DOCUMENTCACHE_H

View File

@ -16,8 +16,6 @@
#include "pixmapcache.h"
PixmapCache PixmapCache::instance;
QPixmap PixmapCache::get(const QString &filename, QSize size)
{
auto itr = cache.find(filename);
@ -36,6 +34,7 @@ QPixmap PixmapCache::get(const QString &filename, QSize size)
PixmapCache &PixmapCache::getInstance()
{
static PixmapCache instance;
return instance;
}

View File

@ -34,7 +34,6 @@ protected:
private:
QHash<QString, QIcon> cache;
static PixmapCache instance;
};
#endif // ICONCACHE_H