[gtkmm] Method Gtk::Object::destroy_notify_() (in File gtk/gtkmm/object.c c) contains a "delete this"
- From: "Hopfes, Harald" <Harald Hopfes Hopfes sysde eads net>
- To: "'gtkmm-list gnome org'" <gtkmm-list gnome org>
- Subject: [gtkmm] Method Gtk::Object::destroy_notify_() (in File gtk/gtkmm/object.c c) contains a "delete this"
- Date: Mon, 26 Aug 2002 13:57:51 +0200
Hi!
I still looking for the cause of bug
http://bugzilla.gnome.org/show_bug.cgi?id=78578
and I found the "delete this" statement in gtk/gtkmm/object.cc
I hope the author of the "delete this" considered the following:
Your program will crash (or behave strangely) if the object
- was not created with 'new'; (might _NOT_ be allocated on the heap, but on
the stack ... which could cause a disaster)
- is a member of an array created with 'new[]';
- is later the object of an explicit 'delete';
- is referenced anyplace after the 'delete', such as by the function which
invoked the cleaner.
Calling the cleaner from another member function would be particularly
interesting :-)
Sometimes you can be sure that it is safe to 'delete this'. In general, it
is dangerous.
Harald
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]