woot
New Member
- Reaction score
- 8
I know there's a GUI leak checker program.. but is there a JASS leak checker?
I know how leaks work.. I just want to be sure I didn't accidentally miss something in my code..
Addition:
Romek posted this multiboard that counts the handles in your game:
Works really well (And it only runs on debug mode)
I know how leaks work.. I just want to be sure I didn't accidentally miss something in my code..
Addition:
Romek posted this multiboard that counts the handles in your game:
JASS:
scope HC initializer Init
globals
private leaderboard udg_HandleBoard
endglobals
private function L2I takes location P returns integer
return P
return 0
endfunction
private function Update takes nothing returns nothing
local integer i = 0
local integer id
local location array P
local real result=0
loop
exitwhen i >= 50
set i = i + 1
set P<i> = Location(0,0)
set id = L2I(P<i>)
set result = result + (id-0x100000)
endloop
set result = result/i-i/2
loop
call RemoveLocation(P<i>)
set P<i> = null
exitwhen i <= 1
set i = i - 1
endloop
call LeaderboardSetItemValue(udg_HandleBoard,0,R2I(result))
endfunction
private function Actions takes nothing returns nothing
set udg_HandleBoard = CreateLeaderboard()
call LeaderboardSetLabel(udg_HandleBoard, "Handle Counter")
call PlayerSetLeaderboard(GetLocalPlayer(),udg_HandleBoard)
call LeaderboardDisplay(udg_HandleBoard,true)
call LeaderboardAddItem(udg_HandleBoard,"Handles",0,Player(0))
call LeaderboardSetSizeByItemCount(udg_HandleBoard,1)
call Update()
call TimerStart(GetExpiredTimer(),0.05,true,function Update)
endfunction
function Init takes nothing returns nothing
debug call TimerStart(CreateTimer(),0,false,function Actions)
endfunction
endscope</i></i></i></i>
Works really well (And it only runs on debug mode)