functionLeaktakesnothingreturnsunitlocalunitu=whateverreturnu//the function stops here so there's no point in adding a "set u = null", but does it leak?endfunction
Actually, yes it does. There's no exception to the bug that local variables do not decrease their reference counter when they go out of scope. You can get around it by moving it into a global variable, the most simplest way in this situation being putting into the [ljass]bj_lastCreatedUnit[/ljass].
Depends on the local variable.
The simple kinds of variables like integers, characters, reals and so on do not leak. In a return statement it isnt their reference (thats the pointer to the specific position in your ram) which is returned but their actual value.
Ghan has said he has fixed this. Monovertex please confirm this fix. This was only a problem with people that had signatures in the upper levels like not the special members but the respected members.