Bug 99435

Summary: _dbus_list_clear (&connection->filter_list); is duplicated in dbus/dbus-connection.c
Product: dbus Reporter: INSUN PYO <insun.pyo>
Component: coreAssignee: D-Bus Maintainers <dbus>
Status: RESOLVED FIXED QA Contact: D-Bus Maintainers <dbus>
Severity: trivial    
Priority: lowest CC: bugzilla
Version: unspecifiedKeywords: patch
Hardware: All   
OS: All   
Whiteboard: review+
i915 platform: i915 features:
Attachments: dbus-connection: Remove a duplicate _dbus_list_clear() call

Description INSUN PYO 2017-01-17 00:21:03 UTC
link = _dbus_list_get_first_link (&connection->filter_list);
  while (link != NULL)
    {
      DBusMessageFilter *filter = link->data;
      DBusList *next = _dbus_list_get_next_link (&connection->filter_list, link);

      filter->function = NULL;
      _dbus_message_filter_unref (filter); /* calls app callback */
      link->data = NULL;

      link = next;
    }

   /************************************* 
    *
    *  Here is duplicated 
    *
   ****************************************/
  _dbus_list_clear (&connection->filter_list);

  /* ---- Done with stuff that invokes application callbacks */

  _dbus_object_tree_unref (connection->objects);

  _dbus_hash_table_unref (connection->pending_replies);
  connection->pending_replies = NULL;

   /************************************* 
    *
    *  Here is duplicated 
    *
   ****************************************/
  _dbus_list_clear (&connection->filter_list);
Comment 1 Philip Withnall 2017-01-17 08:36:28 UTC
Created attachment 128996 [details] [review]
dbus-connection: Remove a duplicate _dbus_list_clear() call

This was doing no harm (clearing an already-cleared list is a no-op),
but it was also pointless.

Signed-off-by: Philip Withnall <withnall@endlessm.com>
Comment 2 Simon McVittie 2017-01-17 14:59:15 UTC
Looks good, thanks
Comment 3 Simon McVittie 2017-01-17 17:24:57 UTC
Fixed in git for 1.11.10

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.