• 🏆 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!

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?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,201
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.
Top