GObject destruction



Hi all

The GObject API docs state something like this:

"It is possible that object methods might be invoked after dispose is
run and before finalize runs. GObject does not consider this to be a
program error: you must gracefully detect this and neither crash nor
warn the user. To do this, you need something like the following code at
the start of each object method, to make sure the object's data is still
valid before manipulating it:

if (self->private->dispose_has_run)
  return;

To do this for each method seems a bit too extreme and verbose (I can't
even find any examples in programs such as GIMP which check if dispose
has been called). I want to know under what circumstances can object
methods be called after dispose is called, and when I should care about it.



Kind regards,

Mukund


-- 
Banu -- Free software science and engineering
http://www.banu.com/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]