Bug 69849

Summary: fix a crash, avoid GValueArray deprecations
Product: Telepathy Reporter: Simon McVittie <smcv>
Component: tp-glibAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium CC: xclaesse
Version: git masterKeywords: patch
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: [0.20] Account: don't crash if a CM returns a non-(ays) Avatar
glib-client-gen.py: ignore GValueArray deprecation warnings
Make more use of tp_value_array_unpack, tp_value_array_build
tp_value_array_free: add
Use tp_value_array_free instead of g_value_array_free
Suppress remaining GValueArray deprecation warnings
Bump GLib deprecation-cleanness to 2.34

Description Simon McVittie 2013-09-26 14:16:31 UTC
I realized while working on something else that we have little enough use of GValueArray to be able to avoid them somewhat easily, at least in telepathy-glib itself.

Then I found a crash while fixing that.
Comment 1 Simon McVittie 2013-09-26 14:17:13 UTC
Created attachment 86645 [details] [review]
[0.20] Account: don't crash if a CM returns a non-(ays) Avatar
Comment 2 Simon McVittie 2013-09-26 14:28:58 UTC
Created attachment 86648 [details] [review]
glib-client-gen.py: ignore GValueArray deprecation  warnings

Yes we know we have GValueArrays.
Comment 3 Simon McVittie 2013-09-26 14:29:20 UTC
Created attachment 86649 [details] [review]
Make more use of tp_value_array_unpack,  tp_value_array_build

As well as being less code, they're not flagged as deprecated.

This requires a bit of extra copying, because there's no
tp_value_array_unpack_dup() or tp_value_array_build_take(), but
it seems worth it.
Comment 4 Simon McVittie 2013-09-26 14:29:33 UTC
Created attachment 86650 [details] [review]
tp_value_array_free: add

This lets connection managers and other Telepathy modules free the
result of tp_value_array_build() without deprecation warnings.
Comment 5 Simon McVittie 2013-09-26 14:29:48 UTC
Created attachment 86651 [details] [review]
Use tp_value_array_free instead of g_value_array_free
Comment 6 Simon McVittie 2013-09-26 14:29:57 UTC
Created attachment 86652 [details] [review]
Suppress remaining GValueArray deprecation warnings
Comment 7 Simon McVittie 2013-09-26 14:30:08 UTC
Created attachment 86653 [details] [review]
Bump GLib deprecation-cleanness to 2.34
Comment 8 Simon McVittie 2013-09-26 14:30:49 UTC
(In reply to comment #1)
> Created attachment 86645 [details] [review]
> [0.20] Account: don't crash if a CM returns a non-(ays) Avatar

Er, "... if MC returns ...". I'll amend.

That's all the patches here.
Comment 9 Xavier Claessens 2013-09-26 15:11:36 UTC
Looks good. Can't wait for porting to GDBus to remove all that :)

I'm just wondering why you put parenthesis around the function name there:
+(tp_value_array_free) (GValueArray *va)
Comment 10 Simon McVittie 2013-09-26 15:33:42 UTC
(In reply to comment #9)
> I'm just wondering why you put parenthesis around the function name there:
> +(tp_value_array_free) (GValueArray *va)

16:16 < smcv> xclaesse: to stop it expanding the tp_value_array_free(va) macro
16:18 < xclaesse> ah, ok

Thanks, merged to the new 0.23.x branch for 0.23.0 (with the first patch also merged for 0.20.5 and 0.22.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.