Bug 28793 - consider having PendingOperation ref itself and its parent until finished
Summary: consider having PendingOperation ref itself and its parent until finished
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-qt (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Olli Salli
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-28 05:48 UTC by Simon McVittie
Modified: 2010-11-16 07:07 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Simon McVittie 2010-06-28 05:48:07 UTC
PendingOperation and its subclasses don't guarantee to stay alive until the operation finishes.

The equivalent constructs in the GLib world (GAsyncResult, TpProxyPendingCall etc.) tend to keep a reference to themselves and the object they belong to for the duration of the call, for greater predictability. We should consider doing the same in telepathy-qt4.

I haven't investigated whether there are precedents either way in Qt/KDE.

13:35 < albanc> smcv, andrunko :  I don't keep a reference on the 
                PendingChannelRequest object returned by 
                Tp::Account->ensureChannel. I guess the object is released too 
                soon. I also have this warning:
13:35 < albanc> Telepathy-Qt4 (version 0.3.4) WARNING: 
                Tp::PendingOperation(0x326b40) still pending when it was 
                deleted - finished will never be emitted
13:35 < smcv> albanc: yeah don't do that :-P
...
13:38 < smcv> andrunko: would it make sense for the PendingOperation to keep 
              itself alive artificially until it finishes?
13:39 < smcv> andrunko: (a GAsyncResult keeps itself and its parent object 
              alive)
13:40 < andrunko> smcv, maybe, the problem is that if we have a bug and nobody 
                  calls finish we will leak
13:41 < smcv> andrunko: welcome to reference counting. I personally think a 
              leak is less bad than objects disappearing before they ought to
13:41 < smcv> and it's a bug either way
Comment 1 Olli Salli 2010-11-05 00:47:56 UTC
They *will* ref the parent in 0.5.0, will make sure.
Comment 2 Olli Salli 2010-11-16 07:07:04 UTC
Fix merged to master. Will be in 0.5.0.


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.