Skip to content

Commit

Permalink
[fix] Using QPointer instead of raw pointer. (#8)
Browse files Browse the repository at this point in the history
* Added some comments

* [fix] Fixed autostart function of lingmo-session

* [fix] Using QPointer instead of raw pointer.

* Remove redundant space.
  • Loading branch information
elysia-best authored Jul 9, 2024
1 parent a046f16 commit 3af05e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions session/daemon-helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <QDebug>
#include <QPair>
#include <QString>
#include <QStringList>
#include <QPointer>

namespace LINGMO_SESSION {
Daemon::Daemon(const QList<QPair<QString, QStringList>> &processList, bool _enableAutoStart, QObject *parent)
Expand All @@ -21,7 +21,7 @@ Daemon::Daemon(const QList<QPair<QString, QStringList>> &processList, bool _enab
}

void Daemon::onProcessError(QProcess::ProcessError error) {
auto process = qobject_cast<QProcess *>(sender());
const QPointer process = qobject_cast<QProcess *>(sender());

if (!process)
return;
Expand All @@ -41,7 +41,7 @@ void Daemon::onProcessError(QProcess::ProcessError error) {
}

void Daemon::startProcess(const QPair<QString, QStringList> &processInfo) {
auto process = new QProcess(this);
const QPointer process = new QProcess(this);

if (this->m_enableAutoRestart)
connect(process, &QProcess::errorOccurred,
Expand Down

0 comments on commit 3af05e5

Please sign in to comment.