Make sure that BaseWorker deletes the thread when is finished.
Implemented ClientManager so it can manage the usb and wireless threads. Impelmented better mutex logic on CmaClient. Execute the cma events in a different thread so the event listener is available. Code refactoring. Fix memory leaks in threads. Updated readme.
This commit is contained in:
37
clientmanager.h
Normal file
37
clientmanager.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef CLIENTMANAGER_H
|
||||
#define CLIENTMANAGER_H
|
||||
|
||||
#include "database.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QThread>
|
||||
|
||||
class ClientManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ClientManager(QObject *parent = 0);
|
||||
|
||||
void start();
|
||||
void stop();
|
||||
|
||||
private:
|
||||
int thread_count;
|
||||
QMutex mutex;
|
||||
|
||||
Database db;
|
||||
QThread *usb_thread;
|
||||
QThread *wireless_thread;
|
||||
|
||||
signals:
|
||||
void deviceConnected(QString);
|
||||
void deviceDisconnected();
|
||||
void receivedPin(int);
|
||||
void stopped();
|
||||
|
||||
private slots:
|
||||
void refreshDatabase();
|
||||
void threadStopped();
|
||||
};
|
||||
|
||||
#endif // CLIENTMANAGER_H
|
Reference in New Issue
Block a user