[Bug 271943] Random crash when connecting

David Edmundson kde at davidedmundson.co.uk
Fri Apr 29 14:07:18 CEST 2011


https://bugs.kde.org/show_bug.cgi?id=271943





--- Comment #1 from David Edmundson <kde davidedmundson co uk>  2011-04-29 14:07:17 ---
[13:13] <oggis_> d_ed: that is a bit confusing, but also there are time windows
during which account->connectionStatus() and account->connection()->status()
aren't the same
[13:14] <oggis_> because account->connectionStatus() is the status which MC has
picked up and then signaled to tp-qt4
[13:14] <oggis_> while Connection::status() is the status got from the CM
directly, except changes to it are also delayed until all the state for the new
status has been downloaded
[13:15] <oggis_> in essence you shouldn't use Account::connectionStatus() for
much more than maybe GUI display on whether an account is connected /
connecting / offline
[13:15] <d_ed> ok, what I have is we're checking account->connectionStatus,
then doing account->connection()->contactManager() 
[13:15] <d_ed> and it's crashing because connection() returns 0
[13:15] <oggis_> no, you'll die
[13:15] <oggis_> check account->connection() for being non-NULL, then use it :)
[13:16] <oggis_> and you should be listening to the connectionChanged() signal
as well - not using connectionStatusChanged() for that purpose
[13:16] <d_ed> "as well" or "instead of"
[13:17] <oggis_> listen to that signal as well, instead of using
connectionStatusChanged() for that purpose
[13:17] <oggis_> as well as in in addition to checking for connection() being
non-NULL

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the KDE-Telepathy mailing list