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:
parent
7321127794
commit
09291bad52
|
@ -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)
|
||||
{
|
||||
documents.push(doc);
|
||||
if(doc)
|
||||
documents.push(doc);
|
||||
}
|
||||
|
||||
DocumentCache &DocumentCache::getInstance()
|
||||
{
|
||||
static DocumentCache instance;
|
||||
return instance;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@ protected:
|
|||
|
||||
private:
|
||||
QStack<QTextDocument*> documents;
|
||||
static DocumentCache instance;
|
||||
};
|
||||
|
||||
#endif // DOCUMENTCACHE_H
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,6 @@ protected:
|
|||
|
||||
private:
|
||||
QHash<QString, QIcon> cache;
|
||||
static PixmapCache instance;
|
||||
};
|
||||
|
||||
#endif // ICONCACHE_H
|
||||
|
|
Loading…
Reference in New Issue
Block a user