[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-dev] Memory leak in array.cpp
From: |
Udo Giacomozzi |
Subject: |
[Gnash-dev] Memory leak in array.cpp |
Date: |
Fri, 29 Jun 2007 11:45:58 +0200 |
I found a memory leak in array.cpp and need some help fixing it.
At line 889 there is function attachArrayProperties():
static void
attachArrayProperties(as_object& proto)
{
boost::intrusive_ptr<builtin_function> gettersetter;
gettersetter = new builtin_function(&array_length, NULL);
proto.init_property("length", *gettersetter, *gettersetter);
}
Valgrind reports that "gettersetter" is "defenitely lost" (never
freed). I confirmed this by uncommenting the function's code, which
"fixes" the memory leak.
Unfortunately I don't know much about intrusive_ptr but does
"*gettersetter" not just return the pointer itself without changing
it's reference count? At the other hand I don't understand why
"gettersetter" is freed immediately when the function returns..
Can somebody help me out here? This should fix memory leaks for
each(!) function call.
Testcase:
Simplistic movie (attached) with just this code:
this.onEnterFrame = function() {};
Udo
memleak-test2.swf
Description: application/shockwave-flash
- [Gnash-dev] Memory leak in array.cpp,
Udo Giacomozzi <=