• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] finding leak in trigger

Status
Not open for further replies.
Level 8
Joined
Jul 15, 2012
Messages
143
i want ask something

i use this jass for finding leak in my map

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_HandleCount_Copy takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterTimerEvent(t,0.09,true)
    call TriggerAddAction(t,function HandleCount)
endfunction

and i found leak in this trigger , i already make it short

  • bug
    • Events
      • Time - Every 0.05 seconds of game time
    • Conditions
    • Actions
      • Set LkasiTrap = (Position of Paladin 0002 <gen>)
      • Set Unit_Groups = (Units within 150.00 of LkasiTrap)
      • Custom script: call DestroyGroup(udg_Unit_Groups)
      • Custom script: set udg_Unit_Groups = null
      • Custom script: call RemoveLocation(udg_LkasiTrap)
how to fix the leak ?
 

Attachments

  • testing.w3x
    18.3 KB · Views: 46
Last edited by a moderator:
Level 8
Joined
Jul 15, 2012
Messages
143
Still cant , the number still increasing
 

Attachments

  • bug.JPG
    bug.JPG
    4.9 KB · Views: 71
Level 23
Joined
Apr 16, 2012
Messages
4,041
your logic john is flawed, if you null group and then you try to destroy it, you will try to destroy null group, that will create leak

If you null agent without destroying/removing it, it will leak, if you dont null local agents the handle counter will be kept(maybe 4 bytes/non nulling)

I once found out printing handle ids of timers that the handle id is not recycled immedietally, it is recycled in buches, so after like 3000 handle ids it flushed them all at once
 
Level 8
Joined
Jul 15, 2012
Messages
143
your logic john is flawed, if you null group and then you try to destroy it, you will try to destroy null group, that will create leak

If you null agent without destroying/removing it, it will leak, if you dont null local agents the handle counter will be kept(maybe 4 bytes/non nulling)

I once found out printing handle ids of timers that the handle id is not recycled immedietally, it is recycled in buches, so after like 3000 handle ids it flushed them all at once

so how to fix that leak edo ??
 
Status
Not open for further replies.
Top