Fix crash in daemon
I was getting a crash in daemon. This seems to fix it, but I have no idea why TBH.
Application: KDE Connect Daemon (kdeconnectd), signal: Segmentation fault Using host libthread_db library "/usr/lib/libthread_db.so.1". [Current thread is 1 (Thread 0x7f8bf24d0800 (LWP 18746))]
Thread 3 (Thread 0x7f8beb018700 (LWP 18749)):
#0 0x00007f8bf4ed03a9 in g_mutex_lock () from /usr/lib/libglib-2.0.so.0
#1 0x00007f8bf4f20d4e in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#2 0x00007f8bf4f22636 in ?? () from /usr/lib/libglib-2.0.so.0
#3 0x00007f8bf4f2277e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#4 0x00007f8bf6cb7cb4 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#5 0x00007f8bf6c60a8c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#6 0x00007f8bf6aa4569 in QThread::exec() () from /usr/lib/libQt5Core.so.5
#7 0x00007f8bf6aa596c in ?? () from /usr/lib/libQt5Core.so.5
#8 0x00007f8bf5d63a9d in start_thread () from /usr/lib/libpthread.so.0
#9 0x00007f8bf65f0b23 in clone () from /usr/lib/libc.so.6
Thread 2 (Thread 0x7f8beb819700 (LWP 18748)):
#0 0x00007f8bf65e17a4 in read () from /usr/lib/libc.so.6
#1 0x00007f8bf4ed0961 in ?? () from /usr/lib/libglib-2.0.so.0
#2 0x00007f8bf4f20e40 in g_main_context_check () from /usr/lib/libglib-2.0.so.0
#3 0x00007f8bf4f22636 in ?? () from /usr/lib/libglib-2.0.so.0
#4 0x00007f8bf4f2277e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#5 0x00007f8bf6cb7cb4 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#6 0x00007f8bf6c60a8c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#7 0x00007f8bf6aa4569 in QThread::exec() () from /usr/lib/libQt5Core.so.5
#8 0x00007f8bf7b56ba6 in ?? () from /usr/lib/libQt5DBus.so.5
#9 0x00007f8bf6aa596c in ?? () from /usr/lib/libQt5Core.so.5
#10 0x00007f8bf5d63a9d in start_thread () from /usr/lib/libpthread.so.0
#11 0x00007f8bf65f0b23 in clone () from /usr/lib/libc.so.6
Thread 1 (Thread 0x7f8bf24d0800 (LWP 18746)):
[KCrash Handler]
#6 0x00007f8bf6b0c383 in QMapNodeBase::nextNode() const () from /usr/lib/libQt5Core.so.5
#7 0x00007f8bf86dce16 in QMapNode<QString, Device*>::nextNode (this=0x556647802fc0) at /usr/include/qt/QtCore/qmap.h:118
#8 0x00007f8bf86dc027 in QMap<QString, Device*>::const_iterator::operator++ (this=0x7ffe09aed218) at /usr/include/qt/QtCore/qmap.h:494
#9 0x00007f8bf86da050 in Daemon::cleanDevices (this=0x55664776c150) at /home/nico/workspace/kdeconnect-kde/core/daemon.cpp:139
#10 0x00007f8bf86d9eae in Daemon::releaseDiscoveryMode (this=0x55664776c150, key=...) at /home/nico/workspace/kdeconnect-kde/core/daemon.cpp:125
#11 0x00007f8bf86b38a9 in Daemon::qt_static_metacall (_o=0x55664776c150, _c=QMetaObject::InvokeMetaMethod, _id=7, _a=0x7ffe09aed450) at /home/nico/workspace/kdeconnect-kde/build/core/kdeconnectcore_autogen/EWIEGA46WW/moc_daemon.cpp:187
#12 0x00007f8bf86b4137 in Daemon::qt_metacall (this=0x55664776c150, _c=QMetaObject::InvokeMetaMethod, _id=7, _a=0x7ffe09aed450) at /home/nico/workspace/kdeconnect-kde/build/core/kdeconnectcore_autogen/EWIEGA46WW/moc_daemon.cpp:317
#13 0x00005566471c082e in DesktopDaemon::qt_metacall (this=0x55664776c150, _c=QMetaObject::InvokeMetaMethod, _id=12, _a=0x7ffe09aed450) at /home/nico/workspace/kdeconnect-kde/build/daemon/kdeconnectd_autogen/include/kdeconnectd.moc:113
#14 0x00007f8bf7b629ef in ?? () from /usr/lib/libQt5DBus.so.5
#15 0x00007f8bf7b67389 in ?? () from /usr/lib/libQt5DBus.so.5
#16 0x00007f8bf7b6785e in ?? () from /usr/lib/libQt5DBus.so.5
#17 0x00007f8bf7b6a16e in ?? () from /usr/lib/libQt5DBus.so.5
#18 0x00007f8bf6c8d102 in QObject::event(QEvent*) () from /usr/lib/libQt5Core.so.5
#19 0x00007f8bf762ce24 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#20 0x00007f8bf76345f1 in QApplication::notify(QObject*, QEvent*) () from /usr/lib/libQt5Widgets.so.5
#21 0x00007f8bf6c61df9 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /usr/lib/libQt5Core.so.5
#22 0x00007f8bf6c64ee8 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /usr/lib/libQt5Core.so.5
#23 0x00007f8bf6cb86c4 in ?? () from /usr/lib/libQt5Core.so.5
#24 0x00007f8bf4f207bf in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#25 0x00007f8bf4f22739 in ?? () from /usr/lib/libglib-2.0.so.0
#26 0x00007f8bf4f2277e in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#27 0x00007f8bf6cb7c99 in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#28 0x00007f8bf6c60a8c in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQt5Core.so.5
#29 0x00007f8bf6c68de6 in QCoreApplication::exec() () from /usr/lib/libQt5Core.so.5
#30 0x00005566471c06b3 in main (argc=1, argv=0x7ffe09aede18) at /home/nico/workspace/kdeconnect-kde/daemon/kdeconnectd.cpp:105
[Inferior 1 (process 18746) detached]
Edited by Nicolas Fella