mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-23 01:27:15 +02:00
Check _sniDBusProxy for nullptr before connecting to signals
This commit is contained in:
parent
bad888496c
commit
1e2759840d
1 changed files with 10 additions and 6 deletions
|
@ -528,11 +528,13 @@ void MainWindow::initHook() {
|
|||
nullptr,
|
||||
nullptr);
|
||||
|
||||
g_signal_connect(
|
||||
_sniDBusProxy,
|
||||
"g-signal",
|
||||
G_CALLBACK(sniSignalEmitted),
|
||||
nullptr);
|
||||
if (_sniDBusProxy) {
|
||||
g_signal_connect(
|
||||
_sniDBusProxy,
|
||||
"g-signal",
|
||||
G_CALLBACK(sniSignalEmitted),
|
||||
nullptr);
|
||||
}
|
||||
|
||||
auto sniWatcher = new QDBusServiceWatcher(
|
||||
kSNIWatcherService.utf16(),
|
||||
|
@ -1232,7 +1234,9 @@ MainWindow::~MainWindow() {
|
|||
delete _mainMenuExporter;
|
||||
delete psMainMenu;
|
||||
|
||||
g_object_unref(_sniDBusProxy);
|
||||
if (_sniDBusProxy) {
|
||||
g_object_unref(_sniDBusProxy);
|
||||
}
|
||||
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue