GNOME Bugzilla – Bug 353424
html_tokenizer_finalize() does not chain up to GObject
Last modified: 2006-12-04 03:19:09 UTC
html_tokenizer_finalize() does not chain up to GObject's finalize() method. This becomes a problem when using GObject's debugging facilities to check for stale instances at exit. When GObject is compiled with debugging enabled and the environment variable G_DEBUG is set to "objects", GObject traps finalized objects that did not properly chain up to the GObject finalize() method.
Created attachment 71843 [details] [review] Proposed patch This patch includes a couple other minor things I noticed: - Several of the classes in a11y have empty finalize() methods. One of them was causing a leaked GailTextUtil instance, the rest I removed. - The "AtkObject *tree" field in GtkHTMLA11Y instances is unused, so I removed that as well. The source code compiled fine without it.
Please add a "Fixes #353424" to my ChangeLog comment. Forgot that.
Matthew : Thanks for the patch. Looks fine but I just wondered if a 'null' implementation should be preferred to a no implementation - just to retain the boilerplate skeleton, given that there is a lot of copy-paste code propogation in Evo. Thoughts ??
Well the boilerplate skeleton should at least chain up to its parent class, so that GObject's finalize() method gets called (which is what this bug is about). This of course happens automatically if you *don't* override the finalize() method, which is why I chose to remove the code. Plus it's a bit more efficient. I admit that I didn't consider the value of a consistent boilerplate to help guide less experienced GObject programmers. So I could go either way. I'd be happy to submit a revised patch, if you'd like.
always welcome, i'd say :-)
Created attachment 74741 [details] [review] Alternate patch Here's an alternate patch that retains the boilerplate code as Harish suggested. Either patch will close this bug.
Matthew, Please commit.
Committed to HEAD.
Update patch status.