[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnash-dev] Memory leak in array.cpp
From: |
Bastiaan Jacques |
Subject: |
Re: [Gnash-dev] Memory leak in array.cpp |
Date: |
Fri, 29 Jun 2007 12:10:49 +0200 (CEST) |
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