- Joined
- Aug 7, 2013
- Messages
- 1,342
Hi,
I was curious if when one calls a function that returns a handle, does that cause a leak, or does the game know to destroy that handle automatically (since it's not being stored in any variable outside the function because our function is preceded by a call)
Here is an example.
I was curious if when one calls a function that returns a handle, does that cause a leak, or does the game know to destroy that handle automatically (since it's not being stored in any variable outside the function because our function is preceded by a call)
Here is an example.
JASS:
function foo takes nothing returns rect
return Rect(0.00, 0.00, 0.00, 0.00)
endfunction
...
call foo() //is there now a leaked rect handle in the map?
...
local rect r
set r = foo() //do I need it this way?
call RemoveRect(r)
set r = null