fix(frontend):修复了一个远程桌面连接时偶现的崩溃问题
该问题曾导致远程连接建立后,本地进程退出后,远程的进程dbus接口被调用时偶现崩溃
This commit is contained in:
parent
86c8ea5296
commit
ca2c333ab5
|
@ -73,21 +73,9 @@ UkuiSearchDbusServices::UkuiSearchDbusServices(MainWindow *m, QObject *parent):
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UkuiSearchDbusServices::~UkuiSearchDbusServices()
|
|
||||||
{
|
|
||||||
if(m_watcher) {
|
|
||||||
delete m_watcher;
|
|
||||||
m_watcher = nullptr;
|
|
||||||
}
|
|
||||||
if(m_serviceIface) {
|
|
||||||
delete m_serviceIface;
|
|
||||||
m_serviceIface = nullptr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void UkuiSearchDbusServices::initWatcher()
|
void UkuiSearchDbusServices::initWatcher()
|
||||||
{
|
{
|
||||||
m_watcher = new QDBusServiceWatcher(QStringLiteral("com.ukui.search.service"),QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange);
|
m_watcher = new QDBusServiceWatcher(QStringLiteral("com.ukui.search.service"),QDBusConnection::sessionBus(), QDBusServiceWatcher::WatchForOwnerChange, this);
|
||||||
connect(m_watcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &UkuiSearchDbusServices::onServiceOwnerChanged);
|
connect(m_watcher, &QDBusServiceWatcher::serviceOwnerChanged, this, &UkuiSearchDbusServices::onServiceOwnerChanged);
|
||||||
connectToService();
|
connectToService();
|
||||||
}
|
}
|
||||||
|
@ -131,9 +119,7 @@ UkuiSearchDbusServices::onServiceOwnerChanged(const QString &service, const QStr
|
||||||
|
|
||||||
void UkuiSearchDbusServices::connectToService()
|
void UkuiSearchDbusServices::connectToService()
|
||||||
{
|
{
|
||||||
if(!m_serviceIface) {
|
m_serviceIface = new OrgUkuiSearchServiceInterface(QStringLiteral("com.ukui.search.service"), "/", QDBusConnection::sessionBus(), this);
|
||||||
m_serviceIface = new OrgUkuiSearchServiceInterface(QStringLiteral("com.ukui.search.service"), "/", QDBusConnection::sessionBus());
|
|
||||||
}
|
|
||||||
connect(m_serviceIface, &OrgUkuiSearchServiceInterface::showWindowSignal, this, &UkuiSearchDbusServices::onShowWindow);
|
connect(m_serviceIface, &OrgUkuiSearchServiceInterface::showWindowSignal, this, &UkuiSearchDbusServices::onShowWindow);
|
||||||
connect(m_serviceIface, &OrgUkuiSearchServiceInterface::searchKeywordSignal, this, &UkuiSearchDbusServices::onSearchKeyword);
|
connect(m_serviceIface, &OrgUkuiSearchServiceInterface::searchKeywordSignal, this, &UkuiSearchDbusServices::onSearchKeyword);
|
||||||
connect(m_serviceIface, &OrgUkuiSearchServiceInterface::mainWindowSwitchSignal, this, &UkuiSearchDbusServices::onMainWindowSwitch);
|
connect(m_serviceIface, &OrgUkuiSearchServiceInterface::mainWindowSwitchSignal, this, &UkuiSearchDbusServices::onMainWindowSwitch);
|
||||||
|
@ -143,8 +129,7 @@ void UkuiSearchDbusServices::disConnectToService()
|
||||||
{
|
{
|
||||||
if(m_serviceIface) {
|
if(m_serviceIface) {
|
||||||
m_serviceIface->disconnect();
|
m_serviceIface->disconnect();
|
||||||
delete m_serviceIface;
|
m_serviceIface->deleteLater();
|
||||||
m_serviceIface = nullptr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,6 @@ class UkuiSearchDbusServices: public QObject, public QDBusContext
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit UkuiSearchDbusServices(MainWindow *m, QObject *parent = nullptr);
|
explicit UkuiSearchDbusServices(MainWindow *m, QObject *parent = nullptr);
|
||||||
~UkuiSearchDbusServices();
|
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void showWindow();
|
void showWindow();
|
||||||
|
|
Loading…
Reference in New Issue