Bug 39200

Summary: Avoid using a NULL hash table
Product: Telepathy Reporter: vincent
Component: tp-farstreamAssignee: Olivier Crête <olivier.crete>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: guillaume.desmottes
Version: git masterKeywords: patch
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description vincent 2011-07-13 11:45:49 UTC
A couple of fixes to using a NULL hash table (two different places) which would trigger upon cancelling a call we'd just started.

http://cgit.collabora.com/git/user/vincent/telepathy-farstream/log/?h=conf

Also a cosmetic patch that's not worth a bug entry by itself.
Comment 1 Olivier Crête 2011-07-13 12:43:29 UTC
@@ -231,6 +231,30 @@ tf_call_channel_dispose (GObject *object)
...
+      while (g_hash_table_iter_next (&iter, &key, &value))
+        {
+          TfCallContent *content = TF_CALL_CONTENT (value);
+          if (content)
+            tf_call_content_on_call_channel_gone (content);

Why do you have a if (content) here? In which case could the value be NULL ?
Comment 2 Olivier Crête 2011-07-13 12:54:42 UTC
The other patches are committed
Comment 3 vincent 2011-07-13 13:41:15 UTC
Reflex safety I guess, I do not have a particular reason to believe it could be NULL.

Branch rebased, amended to remove that check, and repushed.
Comment 4 Olivier Crête 2011-07-13 14:08:42 UTC
Now that I think more about it, maybe it shoudl just call g_object_run_dispose(content); and make sure every entry point and async callback in the CallContent object checks if the object is still valid.
Comment 5 vincent 2011-07-14 04:12:42 UTC
Branch updated with a version that forces dispose on the content, and adds checks to avoid the last ref holder crashing.
I don't like this much tbh.

Note that for added fun, calling g_simple_async_result_complete in got_content_media_properties will cause that dispose to be called, so the content becomes invalid in the middle of that function. This is guarded for in process_codec_offer now.
Comment 6 Olivier Crête 2011-07-14 13:34:33 UTC
*** Bug 34816 has been marked as a duplicate of this bug. ***
Comment 7 Olivier Crête 2011-07-14 13:43:47 UTC
merged

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.