Bug 26107 - Various fixes to the state of CodecOffers including correctly replacing and freeing them.
Summary: Various fixes to the state of CodecOffers including correctly replacing and f...
Alias: None
Product: Telepathy
Classification: Unclassified
Component: gabble (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Sjoerd Simons
QA Contact: Telepathy bugs list
URL: http://git.collabora.co.uk/?p=user/ma...
Keywords: patch
Depends on:
Reported: 2010-01-18 17:03 UTC by Mike Ruprecht
Modified: 2010-01-22 06:46 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Description Mike Ruprecht 2010-01-18 17:03:27 UTC
See summary.
Comment 1 Sjoerd Simons 2010-01-20 06:15:41 UTC

* The new code in dispose should never be hit. the AsyncResult will have a ref on the codec offer. 
* When getting cancelled, please unregister the object from the bus right away. To be sure you don't get accept or reject called afterwards

  * You're leaking the cancellable when switching offers
  * In general it's not guaranteed that if you cancel an async function the result will be an error. 
    So check earlier whether it was an old or a new offer. 
  Implementing it like this will fuck up your refounting if you switch codec offers while deinitting. Imagine 
  the following sequence:
     * A codec offer is started
     * A new one is started, the old one gets cancelled
     * the stream gets deinitialized. the last codec offer gets cancelled as well, so there are now 
       two cancelled operations that haven't returned just yet. _finished_cb will get called twice,
      dropping the last ref the first time and using a disposed object the second time...

Also when calling deinit on the contact it should make itself drop of the bus asap and also make its streams do the same.
Comment 2 Mike Ruprecht 2010-01-20 20:04:15 UTC
Updated my branch per your review comments.
Comment 3 Sjoerd Simons 2010-01-21 03:57:14 UTC
Your refcounting it still potentially racy. Although in practise it works as the older offers cancellation will come through first.  A slightly more elegant solution would be appreciated though
Comment 4 Mike Ruprecht 2010-01-21 19:25:14 UTC
Updated the branch per your review comments.
Comment 5 Sjoerd Simons 2010-01-22 06:46:35 UTC
Looks fine, merging

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.