GNOME Bugzilla – Bug 87591
GTK+ merged docs has notions of free() which isn't used in gtkmm.
Last modified: 2004-12-22 21:47:04 UTC
The documentation for Gtk::TextView::get_attributes(): The return value is a copy owned by the caller of this function, and should be freed. Am I right to assume that this line shouldn't be there? Since you don't "free" things in C++, it will be destroyed when it gets out of scope, which is what any C++ programmer would expect. I will create a patch if my assumptions are right.
Yes, you are correct. You might need to use the gtk_docs_override.xml file for this. You mean get_default_attributes(), I guess.
Created attachment 9831 [details] [review] Patch to correct documentation and two small unrelated changes.
Here's the patch. I actually couldn't get gtk_docs_override.xml working locally, and it doesn't seem to work in the generated docs on http://gtkmm.org/gtkmm2/ with the example which was there already. Also, while searching through gtk_docs.xml for the word "free", it seems that many functions talks about "freeing" things etc. So this bug is not closed yet, it requires a bit more work..
Are you actually generating the Doxygen HTML? It seems to be working. I don't see any free here: http://www.gtkmm.org/gtkmm2/reference/html/classGtk_1_1TextView.html#a56 And the example is gtk_box_pack_start(), which is hand-coded anyway. So, would you like to provide a similar patche for the other "free" occurences? Do try to make your patches solve just one thing at a time instead of doing unrelated stuff in the same patch.
I was just testing with the example since *that* should be working. I don't understand what you mean that it's hand-coded. All I know is that there is no documentation for Gtk::Box::pack_start(). Glad to see it working though. Currently I don't have time to make all the non-free changes.
pack_start() doesn't use _WRAP_METHOD() so it doesn't use auto-generate any reference docs. It's just regular C++.
You really need to search the HTML output, because the C docs are not used when we custom code a method. I have fixed what I have found by using grep.