Summary: | Random crash when connecting | ||
---|---|---|---|
Product: | [Unmaintained] telepathy | Reporter: | David Edmundson <kde> |
Component: | contactlist | Assignee: | Telepathy Bugs <kde-telepathy-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | 0.4.0 | ||
Platform: | Unlisted Binaries | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
David Edmundson
2011-04-28 22:45:34 UTC
[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 Git commit be28fa3db185265a3db7ebffe90fc056f76a5e82 by David Edmundson. Committed on 04/05/2011 at 17:59. Pushed by davidedmundson into branch 'master'. Check for connection being valid rather than looking at the connection status before calling monitor presence. There are times when connectionStatus is Connected, but account->connection() returns 0. Converted code to call monitorPresence when connectionChanges() not connectionStatusChanges. Also updated monitorPresence to take a connectionPtr rather than accountPtr as it makes the code easier with this new change. REVIEW: 101288 BUG: 271943 M +11 -10 main-widget.cpp M +1 -1 main-widget.h http://commits.kde.org/telepathy-contact-list/be28fa3db185265a3db7ebffe90fc056f76a5e82 |