forked from qt-creator/qt-creator
Trk: Closing TrkDevice when Launcher emits finished()
Reviewed-by: Friedemann Kleint
This commit is contained in:
@@ -76,6 +76,7 @@ Launcher::Launcher(Actions startupActions) :
|
||||
{
|
||||
d->m_startupActions = startupActions;
|
||||
connect(&d->m_device, SIGNAL(messageReceived(trk::TrkResult)), this, SLOT(handleResult(trk::TrkResult)));
|
||||
connect(this, SIGNAL(finished()), &d->m_device, SLOT(close()));
|
||||
}
|
||||
|
||||
Launcher::~Launcher()
|
||||
|
@@ -893,7 +893,7 @@ bool TrkDevice::open(const QString &port, QString *errorMessage)
|
||||
Qt::QueuedConnection);
|
||||
connect(d->readerThread.data(), SIGNAL(messageReceived(trk::TrkResult,QByteArray)),
|
||||
this, SLOT(slotMessageReceived(trk::TrkResult,QByteArray)),
|
||||
Qt::BlockingQueuedConnection);
|
||||
Qt::QueuedConnection);
|
||||
d->readerThread->start();
|
||||
|
||||
d->writerThread = QSharedPointer<WriterThread>(new WriterThread(d->deviceContext));
|
||||
|
@@ -73,7 +73,6 @@ public:
|
||||
|
||||
bool open(const QString &port, QString *errorMessage);
|
||||
bool isOpen() const;
|
||||
void close();
|
||||
|
||||
QString errorString() const;
|
||||
|
||||
@@ -109,6 +108,9 @@ protected slots:
|
||||
void emitError(const QString &msg);
|
||||
void emitLogMessage(const QString &msg);
|
||||
|
||||
public slots:
|
||||
void close();
|
||||
|
||||
private:
|
||||
void readMessages();
|
||||
TrkDevicePrivate *d;
|
||||
|
Reference in New Issue
Block a user