Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33336
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Reviewed-by: Thiago Macieira <thiago@kde.org>
void *data)
{
DBusList *link;
-
+
+ /* fd.o #33336: we want people to remove their watches before invalidating
+ * them */
+ _dbus_assert (dbus_watch_get_socket (watch) != -1);
+
link = _dbus_list_get_first_link (&loop->callbacks);
while (link != NULL)
{
watch->refcount -= 1;
if (watch->refcount == 0)
{
+ if (watch->fd != -1)
+ _dbus_warn ("this watch should have been invalidated");
+
dbus_watch_set_data (watch, NULL, NULL); /* call free_data_function */
if (watch->free_handler_data_function)