looqs/gui/ipcpreviewworker.h
Albert S 47874b3706 gui: ipcworker,ipcserver: Refactor
Crashes were observed, faulting in libQtNetwork.
Those were rather rare. We also have no traces.

Probably depends on some order signal/slots were
processed. Remove shared states between connections,
such as the IPCPreviewWorker and socket instance in IPCServer.
2022-08-27 11:15:45 +02:00

33 baris
632 B
C++

#ifndef IPCPREVIEWWORKER_H
#define IPCPREVIEWWORKER_H
#include <QLocalSocket>
#include <QFutureWatcher>
#include "renderconfig.h"
#include "rendertarget.h"
#include "previewgenerator.h"
class IPCPreviewWorker : public QObject
{
Q_OBJECT
private:
QFutureWatcher<QByteArray> previewWorkerWatcher;
QLocalSocket *peer;
bool cleaned = false;
public:
IPCPreviewWorker(QLocalSocket *peer);
void start(RenderConfig config, const QVector<RenderTarget> &targets);
void stop();
~IPCPreviewWorker()
{
delete this->peer;
}
private slots:
void shutdownSocket();
signals:
void finished();
};
#endif // IPCPREVIEWWORKER_H