• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[JASS] Multiboarditem leaks?

Status
Not open for further replies.
Hello o/

I have a multiboard that uses 3 multiboaditems to display the current time.
However, using a handle counter I found at wc3c, I saw that the number of handles increases 3 every second - if I disable the multiboarditem functions, it stops.

Here's the code
JASS:
scope CountingTime

private function Actions takes nothing returns nothing
 local integer i = 0
 local multiboarditem mbi
 local string t
    set udg_Time[0] =  udg_Time[0] + 1
    set udg_TimeString = "]|r"
    loop
        exitwhen i > 2
        if udg_Time[i] >= 60 and i < 2 then
            set udg_Time[i+1] = udg_Time[i+1] + 1
            set udg_Time[i] = 0
        endif
        
        if udg_Time[i] < 10 then
            set t = "0" + I2S(udg_Time[i])
        else
            set t = I2S(udg_Time[i])
        endif
        
        set mbi = MultiboardGetItem( udg_Multiboard, udg_TimeRow - 1, 2 - i )
        if i == 2 then
            call MultiboardSetItemValue( mbi, "                               [" + t )
            set udg_TimeString = "|cff808080[" + t + udg_TimeString
        else
            call MultiboardSetItemValue( mbi, ":" + t )
            set udg_TimeString = ":" + t + udg_TimeString
        endif
        call MultiboardReleaseItem(mbi)
        set i = i + 1
    endloop
    set mbi = null
endfunction
endscope

Thanks in advance!
Hossomi
 
Last edited:
Status
Not open for further replies.
Top