• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

A special question to leak

Status
Not open for further replies.
Level 10
Joined
May 21, 2006
Messages
323
I know there are several leak tutorials and I know them all, but here are some more special questions.

  • Multiboard - Set the text for GlobalMenu item in column 2, row 4 to Yes!
Is an action like this leakfree? Or do I have to save all the column numbers, row numbers and the text in variables?
 
Well it might leak a handle once used for a multiboard item...

JASS:
function MultiboardSetItemValueBJ takes multiboard mb,integer col,integer row,string val returns nothing
    local integer curRow = 0
    local integer curCol = 0
    local integer numRows = MultiboardGetRowCount(mb)
    local integer numCols = MultiboardGetColumnCount(mb)
    local multiboarditem mbitem = null
    loop
        set curRow = curRow + 1
        exitwhen curRow > numRows
        if (row == 0 or row == curRow) then
            set curCol = 0
            loop
                set curCol = curCol + 1
                exitwhen curCol > numCols
                if (col == 0 or col == curCol) then
                    set mbitem = MultiboardGetItem(mb, curRow - 1, curCol - 1)
                    call MultiboardSetItemValue(mbitem, val)
                    call MultiboardReleaseItem(mbitem)
                endif
            endloop
        endif
    endloop
endfunction

This is why people should not use GUI.
 
Status
Not open for further replies.
Back
Top