- Joined
- Dec 12, 2012
- Messages
- 1,007
Hello,
I am looking for a system that gives me the number of handles in my map. I need this to detect very small memory leaks that occure in rare situations.
I already searched a bit and found this one, but there it is said that this will only work if you have massive leaks in your map.
I also found this very simple solution:
But somehow the handle counter keeps increasing although my map doesn't contain any leaks (testmap with no leaks).
So... Is there a system that can give me the exact handle count?
Any help is appreciated.
lfh
I am looking for a system that gives me the number of handles in my map. I need this to detect very small memory leaks that occure in rare situations.
I already searched a bit and found this one, but there it is said that this will only work if you have massive leaks in your map.
I also found this very simple solution:
JASS:
function HandleCount takes nothing returns nothing
local location L = Location(0,0)
call BJDebugMsg(I2S(GetHandleId(L)-0x100000))
call RemoveLocation(L)
set L = null
endfunction
//===========================================================================
function InitTrig_HandleCounter takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEvent(t,0.09,true)
call TriggerAddAction(t,function HandleCount)
endfunction
But somehow the handle counter keeps increasing although my map doesn't contain any leaks (testmap with no leaks).
So... Is there a system that can give me the exact handle count?
Any help is appreciated.
lfh