[Bug 32391] New: Correctly deal with removing name owner watches during dispatch of their callbacks
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Tue Dec 14 16:59:57 CET 2010
https://bugs.freedesktop.org/show_bug.cgi?id=32391
Summary: Correctly deal with removing name owner watches during
dispatch of their callbacks
Product: Telepathy
Version: git master
Platform: Other
URL: http://git.collabora.co.uk/?p=user/wjt/telepathy-glib.
git;a=shortlog;h=refs/heads/noc-fixes
OS/Version: All
Status: NEW
Keywords: patch
Severity: normal
Priority: medium
Component: tp-glib
AssignedTo: telepathy-bugs at lists.freedesktop.org
ReportedBy: will.thompson at collabora.co.uk
QAContact: telepathy-bugs at lists.freedesktop.org
This is a pretty nasty bug. I'm just going to copy-paste the description from
my test case:
/* Here's a regression test for a bug where, if a name owner watch callback
* removes itself, subsequent callbacks for the same change would not fire.
* This was because the implementation was an array of callbacks, with an index
* i, calling each in turn. So imagine we're dispatching three callbacks,
* starting with 'foo':
*
* | foo | bar | baz |
* i=0
*
* If 'foo' cancels its own watch, it would be removed from the array. Then the
* iteration would continue by incrementing i:
*
* | bar | baz |
* i=1
*
* and 'bar' has not been called! Gulp.
The linked branch fixes this by deleting loads of code.
2085 % git diff --stat telepathy-glib-0.12
telepathy-glib/dbus-daemon.c | 193 +++++++-------------
tests/dbus/dbus.c | 411 +++++++++++++++++++++++++-----------------
2 files changed, 308 insertions(+), 296 deletions(-)
Aww, so close. But:
2086 % git diff --stat telepathy-glib-0.12 telepathy-glib
telepathy-glib/dbus-daemon.c | 193 ++++++++++++++----------------------------
1 files changed, 64 insertions(+), 129 deletions(-)
I can live with that.
--
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the telepathy-bugs
mailing list