Break after handling the read/write
The loop is there because watchers may have two Watcher for the same fd, one for read and one for write, but after we're processed the correct one we don't need to keep looping. This fixes a crash since it's possible that while in processing q_dbus_watch_handle we get a watch added/remove this invalidating the iterator and crashing Change-Id: Icb61deae272d2f237a4c616fae598404d419af90 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
3de7382044
commit
e4eb9bfbf7
|
|
@ -1184,6 +1184,7 @@ void QDBusConnectionPrivate::socketRead(int fd)
|
|||
if (it->watch && it->read && it->read->isEnabled()) {
|
||||
if (!q_dbus_watch_handle(it.value().watch, DBUS_WATCH_READABLE))
|
||||
qDebug("OUT OF MEM");
|
||||
break;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
|
|
@ -1198,6 +1199,7 @@ void QDBusConnectionPrivate::socketWrite(int fd)
|
|||
if (it->watch && it->write && it->write->isEnabled()) {
|
||||
if (!q_dbus_watch_handle(it.value().watch, DBUS_WATCH_WRITABLE))
|
||||
qDebug("OUT OF MEM");
|
||||
break;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue