On Fri, 29 Jun 2007, Udo Giacomozzi wrote:
static void
attachArrayProperties(as_object& proto)
{
boost::intrusive_ptr<builtin_function> gettersetter;
gettersetter = new builtin_function(&array_length, NULL);
Assigning a builtin_function pointer into an intrusive_ptr increments
the reference count. (gettersettter refcnt = 1)
proto.init_property("length", *gettersetter, *gettersetter);
One of the effects of init_property() (in GetterSetter, specifically)
is to increase the reference count by one. (gettersetter refcnt = 2)
}
Function scope ends; due to the intrusive_ptr going out of scope, the
reference count is decremented. (gettersetter refcnt = 1)
gettersetter will not be destroyed until its owner (PropertyList)
decides to do so.
Bastiaan
_______________________________________________
Gnash-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash-dev