Commit 91419d2a authored by Adam Reichold's avatar Adam Reichold

Make initialization of globalParams in the qt5 frontend threadsafe so that...

Make initialization of globalParams in the qt5 frontend threadsafe so that multiple threads can create documents concurrently.
parent e5ab9d3b
......@@ -56,6 +56,7 @@
namespace Poppler {
int DocumentData::count = 0;
QMutex DocumentData::mutex;
Document *Document::load(const QString &filePath, const QByteArray &ownerPassword,
const QByteArray &userPassword)
......
......@@ -252,6 +252,8 @@ namespace Debug {
delete (OptContentModel *)m_optContentModel;
delete doc;
QMutexLocker locker{&mutex};
count --;
if ( count == 0 )
{
......@@ -267,6 +269,8 @@ namespace Debug {
m_hints = 0;
m_optContentModel = nullptr;
QMutexLocker locker{&mutex};
if ( count == 0 )
{
utf8Map = nullptr;
......
......@@ -35,6 +35,7 @@
#define _POPPLER_PRIVATE_H_
#include <QtCore/QFile>
#include <QtCore/QMutex>
#include <QtCore/QPointer>
#include <QtCore/QVector>
......@@ -152,6 +153,7 @@ namespace Poppler {
QColor paperColor;
int m_hints;
static int count;
static QMutex mutex;
};
class FontInfoData
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment