View Single Post
Old 04-20-2017, 04:17 AM   #1
yeeboys
User
 
Join Date: Oct 2013
Posts: 19

yeeboys has little to show at this moment (0)

Default Does the use of this function DistanceBetweenPoints cause memery leak?

this is a function in BJ.

Collapse JASS:
function DistanceBetweenPoints takes location locA, location locB returns real
    local real dx = GetLocationX(locB) - GetLocationX(locA)
    local real dy = GetLocationY(locB) - GetLocationY(locA)
    return SquareRoot(dx * dx + dy * dy)
endfunction

this is a Custom function.

Collapse JASS:
function func1 takes nothing returns nothing
local location A = GetUnitLoc(unit_a)
local location B = GetUnitLoc(unit_b)
local real dist = DistanceBetweenPoints(A,B)
call RemoveLocation(A)
call RemoveLocation(B)
set A = null
set B = null
endfunction

Does the use of this function DistanceBetweenPoints cause memery leak? Local location A and B was removed at func1. But location locA and locB wasn't removed at DistanceBetweenPoints.
yeeboys is offline   Reply With Quote
Sponsored Links - Login to hide this ad!