Glib::Refptr and circular references
- From: "Matt Hoosier" <mwhoosier gmail com>
- To: gtkmm-list gnome org
- Subject: Glib::Refptr and circular references
- Date: Mon, 10 Jul 2006 11:14:12 -0500
Hi all,
The occasion of using a Glib::Refptr from gtkmm's API recently reminds
me about an old question. I've been wondering for some time now how
the GObject-using world deals with the problem of circular references.
The classic example would be a node of a (circular) linked list which
is also pointed to by application code. Once the app drops its ref to
the node, at least one more reference (the internal back-edge from the
linked list) still exists.
Now, I know that Glib has a special-built linked list data structure
to prevent this elementary example, but it's fairly easy to imagine
scenarios where this happens unintentionally. Is this simply a known
limitation, accompanied by the stern warning to be careful in one's
design not to introduce circular references?
Apologies if there's already a manifesto about this somewhere in the
Glib tutorial, but I didn't find it.
--Matt
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]