GNOME Bugzilla – Bug 664069
gvariant: Never break out of g_variant_iter_loop
Last modified: 2012-01-02 17:34:51 UTC
If you break out of a g_variant_iter_loop you get a leak. Document this.
Created attachment 201399 [details] [review] gvariant: Never break out of g_variant_iter_loop * Document how you should not break out of g_variant_iter_loop style loops.
Review of attachment 201399 [details] [review]: ::: glib/gvariant.c @@ +4794,3 @@ * be freed, as appropriate. * + * You must repeatedly to call g_variant_iter_loop until %FALSE is returned. EGRAMMAR @@ +4826,3 @@ * * /<!-- -->* no need to free 'key' and 'value' here *<!-- -->/ + * /<!-- -->* unless breaking out of this loop *<!-- -->/ this conflicts with your stronger statement above which suggests that breaking is completely invalid.
Created attachment 204447 [details] [review] Updated patch. Okay to commit? gvariant: Never break out of g_variant_iter_loop * Document how to break out of g_variant_iter_loop style loops.
Thanks. Committed.