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 107686 - CanvasAA destructor (mem dealloc) bug
CanvasAA destructor (mem dealloc) bug
Status: RESOLVED FIXED
Product: gnomemm
Classification: Deprecated
Component: libgnomecanvasmm
2.0
Other Linux
: Normal normal
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2003-03-06 01:51 UTC by barbapapa
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
valgrind.txt (38.73 KB, text/plain)
2003-07-21 12:45 UTC, Murray Cumming
Details
gfatalwarnings_backtrace.txt (2.52 KB, text/plain)
2003-07-21 12:53 UTC, Murray Cumming
Details

Description barbapapa 2003-03-06 01:51:59 UTC
as opposed to the destructor of Gnome::Canvas::Canvas which works fine,
there seems to be a mem or destructor problem with the Gnome::Canvas::CanvasAA
just take the standard example file from gtkmm:
gnomemm-all-1.3.15/libgnomecanvasmm/examples/canvas/canvas.cc
and modify line 8
class CanvasExample : public Gnome::Canvas::CanvasAA
instead of class CanvasExample : public Gnome::Canvas::Canvas
then the program executes fine wit an AA canvas. however, when closing the
program, the following errors appear:
$ ./canvas
                                                                          
      
(canvas:27026): GLib-GObject-WARNING **: instance of invalid non-instantiatable
type `<invalid>'
  
(canvas:27026): GLib-GObject-CRITICAL **: file gsignal.c: line 2490
(g_signal_emit_valist): assertion `G_TYPE_CHECK_INSTANCE (instance)' failed
  
(canvas:27026): GLib-GObject-CRITICAL **: file gobject.c: line 1337
(g_object_unref): assertion `G_IS_OBJECT (object)' failed

i detected this error on another program (the gtkmm canvas example is just
for illustration)
and since that program worked without err in c, i suppose there is a
destructor error in the CanvasAA wrapper
in my original program, closing the program (which executes and displays
fine even with CanvasAA) gives the following error:
(gaga:20503): GnomeCanvas-CRITICAL **: file gnome-canvas.c: line 3721
(gnome_canvas_request_redraw): assertion `GNOME_IS_CANVAS (canvas)' failed
this error message is repeated for each Canvas::Item that was displayed
before closing the program
just as the gnomemm-all-1.3.15/libgnomecanvasmm/examples/canvas/canvas.cc
file, replacing Gnome::Canvas with Gnome::CanvasAA leads to a working
program that displays perfectly
but with CanvasAA there are errors when the program is closed
conclusion: destructor problem in the Gnome::CanvasAA wrapper
Comment 1 Murray Cumming 2003-03-11 12:52:42 UTC
Maybe it's something to do with this mysterious code in the constructor:
http://cvs.gnome.org/lxr/source/gnomemm/libgnomecanvasmm/libgnomecanvas/src/canvas.ccg#49
Comment 2 Murray Cumming 2003-03-18 16:46:47 UTC
It might help to have an example in C that works. Then we could
compare what the C example does and what libgnomecanvasmm does.
Comment 3 Murray Cumming 2003-04-04 06:46:15 UTC
Could you try to write that C test case?
Comment 4 Murray Cumming 2003-07-21 12:45:38 UTC
Created attachment 18477 [details]
valgrind.txt
Comment 5 Murray Cumming 2003-07-21 12:46:16 UTC
Here's the valgrind output, by the way. (valgrind.txt). The gap in the
middle is between startup and shutdown of the app.
Comment 6 Murray Cumming 2003-07-21 12:53:17 UTC
Created attachment 18478 [details]
gfatalwarnings_backtrace.txt
Comment 7 Murray Cumming 2003-07-21 12:53:52 UTC
And gfatalwarnings_backtrace.txt is a backtrace when running the
program with --g-fatal-warnings.
Comment 8 Murray Cumming 2003-07-21 19:45:27 UTC
Sorry for the delay, and thanks for finding this.

2003-07-21  Murray Cumming  <murrayc@usa.net>
 
        * libgnomecanvas/src/canvas.hg: Use the new
GMMPROC_PROTECTED_GCLASS
        macro on the Canvas class so that the CanvasAA class can access
        canvas_class_.
        * libgnomecanvas/src/canvas.ccg: Rewrite the CanvasAA
constructor to
        use the new (and working) gtkmm2-style construction
construction. Fixes
        bug #107686.
        * configure.in: Now requires gtkmm 2.2.5, which has the new macro.