Bug 69849 - fix a crash, avoid GValueArray deprecations
Summary: fix a crash, avoid GValueArray deprecations
Status: RESOLVED FIXED
Alias: None
Product: Telepathy
Classification: Unclassified
Component: tp-glib (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Simon McVittie
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2013-09-26 14:16 UTC by Simon McVittie
Modified: 2013-09-26 18:43 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
[0.20] Account: don't crash if a CM returns a non-(ays) Avatar (1022 bytes, patch)
2013-09-26 14:17 UTC, Simon McVittie
Details | Splinter Review
glib-client-gen.py: ignore GValueArray deprecation warnings (3.21 KB, patch)
2013-09-26 14:28 UTC, Simon McVittie
Details | Splinter Review
Make more use of tp_value_array_unpack, tp_value_array_build (20.60 KB, patch)
2013-09-26 14:29 UTC, Simon McVittie
Details | Splinter Review
tp_value_array_free: add (2.89 KB, patch)
2013-09-26 14:29 UTC, Simon McVittie
Details | Splinter Review
Use tp_value_array_free instead of g_value_array_free (20.57 KB, patch)
2013-09-26 14:29 UTC, Simon McVittie
Details | Splinter Review
Suppress remaining GValueArray deprecation warnings (10.12 KB, patch)
2013-09-26 14:29 UTC, Simon McVittie
Details | Splinter Review
Bump GLib deprecation-cleanness to 2.34 (916 bytes, patch)
2013-09-26 14:30 UTC, Simon McVittie
Details | Splinter Review

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.