GNOME Bugzilla – Bug 600751
GCompletion should better document if and how items memory is managed
Last modified: 2012-08-17 06:18:07 UTC
The documentation of GCompletion misses to explain what is done, and therefore what to do, with the memory of inserted items. For example, should the list given to g_completion_add_items() or g_completion_remove_items() be freed by the caller? And its elements' data? Do g_completion_remove_items() and g_completion_clear_items() release the memory allocated for the elements they frees? If not, how to free this memory (e.g. how to know which elements are not needed any more?). Do g_completion_free() release item's memory? I think all theses points must be made clear.
Created attachment 207847 [details] [review] add some explanation of memory management GCompletion is now deprecated, and bookkeeping of the completion items was one reason for this: http://mail.gnome.org/archives/gtk-devel-list/2010-June/msg00193.html Nevertheless, GObject Introspection annotations give some hints, and the attached patch should be sufficient to cover the things that you requested.
Review of attachment 207847 [details] [review]: Sure, looks fine. If you want to push that, go ahead.
Comment on attachment 207847 [details] [review] add some explanation of memory management Thanks, pushed to master as commit 86a4fd6fa98de29f7ee05ba655a00e4c42f11756.