Fixed broken logic when purging notifications.
This commit is contained in:
parent
8f4da674c4
commit
21f62b90ea
1 changed files with 5 additions and 6 deletions
|
@ -1055,14 +1055,13 @@ static DBusHandlerResult filter_dbus_signal(DBusConnection *, DBusMessage *buf,
|
||||||
dbus_message_get_args(buf, NULL,
|
dbus_message_get_args(buf, NULL,
|
||||||
DBUS_TYPE_UINT32, &id,
|
DBUS_TYPE_UINT32, &id,
|
||||||
DBUS_TYPE_INVALID);
|
DBUS_TYPE_INVALID);
|
||||||
|
|
||||||
std::list<wnotify>::iterator i = notifications.begin(),
|
std::list<wnotify>::iterator i = notifications.begin(),
|
||||||
i_end = notifications.end();
|
i_end = notifications.end();
|
||||||
while (i != i_end) {
|
while (i != i_end && i->id != id) ++i;
|
||||||
std::list<wnotify>::iterator j = i++;
|
if (i != i_end)
|
||||||
if (j->id == id) continue;
|
notifications.erase(i);
|
||||||
notifications.erase(j);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return DBUS_HANDLER_RESULT_HANDLED;
|
return DBUS_HANDLER_RESULT_HANDLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue