After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 353424 - html_tokenizer_finalize() does not chain up to GObject
html_tokenizer_finalize() does not chain up to GObject
Status: RESOLVED FIXED
Product: GtkHtml
Classification: Other
Component: API
3.11.x
Other Linux
: Normal normal
: ---
Assigned To: gtkhtml-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2006-08-29 16:27 UTC by Matthew Barnes
Modified: 2006-12-04 03:19 UTC
See Also:
GNOME target: ---
GNOME version: 2.15/2.16


Attachments
Proposed patch (8.77 KB, patch)
2006-08-29 17:05 UTC, Matthew Barnes
reviewed Details | Review
Alternate patch (5.61 KB, patch)
2006-10-15 04:07 UTC, Matthew Barnes
committed Details | Review

Description Matthew Barnes 2006-08-29 16:27:57 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.
Comment 1 Matthew Barnes 2006-08-29 17:05:20 UTC
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.
Comment 2 Matthew Barnes 2006-08-29 20:53:59 UTC
Please add a "Fixes #353424" to my ChangeLog comment.  Forgot that.
Comment 3 Harish Krishnaswamy 2006-09-18 09:07:40 UTC
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 ??
Comment 4 Matthew Barnes 2006-09-18 12:32:50 UTC
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.
Comment 5 André Klapper 2006-09-25 10:52:27 UTC
always welcome, i'd say :-)
Comment 6 Matthew Barnes 2006-10-15 04:07:43 UTC
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.
Comment 7 Srinivasa Ragavan 2006-12-03 17:29:27 UTC
Matthew, Please commit. 
Comment 8 Matthew Barnes 2006-12-04 03:08:04 UTC
Committed to HEAD.
Comment 9 Harish Krishnaswamy 2006-12-04 03:19:09 UTC
Update patch status.