GNOME Bugzilla – Bug 348809
Gtk::manage() doesn't work with canvas items.
Last modified: 2014-08-02 12:48:32 UTC
Please describe the problem: I have noticed that canvas items I create are not destroyed automatically when the parent group is destroyed. This is contrary to (my understanding of) the C version of the canvas. Also, the C examples for the canvas show items not being explicitly destroyed, while the libgnomecanvasmm examples have explicit destruction of the items. Assuming the examples are correct, then the C++ bindings fundamentally change the way item destruction is done. There is no mention of that anywhere in the (little) documentation provided. Steps to reproduce: Create an item, delete the parent group. Actual results: Nothing, item is not destroyed. Expected results: Item should be destroyed when the parent group is destroyed (specified in the C version of the canvas). Does this happen every time? yes Other information:
Created attachment 69676 [details] testcase When running this program and closing the window, the canvas' destructor gets called, but not the item's destructor.
It would indeed be nice if Gtk::manage() worked with Canvas items. That's the bug here, I think. I don't know whether libgnomecanvasmm intentionally prevents automatic item destruction, as we do with gtkmm child widgets, but it makes sense for us to want it here too. But maybe it's due to code in GtkObject (Gnome::Canvas::Item derives from Gtk::Object).
Created attachment 69677 [details] [review] canvas_example_with_manage.patch This is another test case. The patch changes the existing example to use manage() and demonstrates that the destructor is not called.
As I mentioned on the gtkmm mailing list, we've dropped the idea of using libgnomecanvasmm, so there's probaby nobody waiting for a resolution of this issue anymore. Feel free to close as WONTFIX if that's the case.
Just realised that was still open. I think it's safe to mark that as WONTFIX now. Good thing I wasn't holding my breath ;-)
Personally I am putting time into goocanvas(mm) rather than libgnomecanvas. goocanvas uses reference-counting instead.
The last libgnomecanvasmm code changes took place in 2008: https://git.gnome.org/browse/archive/libgnomecanvasmm/log/ This project is not under active development anymore. This project got recently archived in GNOME Git. It is currently unlikely that there will be any further active development. Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect reality. Please feel free to reopen this bug report in the future if anyone takes the responsibility for active development again.