A problem is how you know when the object goes out of scope. When an inner function returns, it shouldn't free the object even if the bit is clear.
You could avoid freeing objects that are in the function arguments, but as soon as they (or anything inside them) get referenced from other local variables, you don't know anymore and have to set the bit to be on the safe side.
/ Martin Stjernholm, Roxen IS
Previous text:
2004-02-05 15:10: Subject: Re: Default backend and thread backends?
I take it that a "leak" is a ref from somewhere else than the stack.
That might be a reasonable definition. It's fairly important that if one passes the local object to a function, that should count as a "leak" only if the called function (or some function it calls in turn) stores a reference somewhere where it might live longer than the function call.
/ Niels Möller (vässar rödpennan)