Bug 99435 - _dbus_list_clear (&connection->filter_list); is duplicated in dbus/dbus-connection.c
Summary: _dbus_list_clear (&connection->filter_list); is duplicated in dbus/dbus-conne...
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: unspecified
Hardware: All All
: lowest trivial
Assignee: D-Bus Maintainers
QA Contact: D-Bus Maintainers
URL:
Whiteboard: review+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-01-17 00:21 UTC by INSUN PYO
Modified: 2017-01-17 17:24 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
dbus-connection: Remove a duplicate _dbus_list_clear() call (1018 bytes, patch)
2017-01-17 08:36 UTC, Philip Withnall
Details | Splinter Review

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.