EotA--memory leaks out the ass

A place to talk about general WC3 and EotA related stuff.
Message
Author
User avatar
DarnYak
Site Admin
Site Admin
Posts: 2364
Joined: August 12th, 2006, 2:54 pm

Re: EotA--memory leaks out the ass

#26 Post by DarnYak »

So, I found this today.

Code: Select all

//===========================================================================
function GetLastCreatedGroupEnum takes nothing returns nothing
    call GroupAddUnit(bj_groupLastCreatedDest, GetEnumUnit())
endfunction

//===========================================================================
function GetLastCreatedGroup takes nothing returns group
    set bj_groupLastCreatedDest = CreateGroup()
    call ForGroup(bj_lastCreatedGroup, function GetLastCreatedGroupEnum)
    return bj_groupLastCreatedDest
endfunction
Thanks blizz, instead of returning bj_lastCreatedGroup, you make a copy and return it for no good reason. Oh i'm sure you had some good reason at some point in development, but this kind of unexpected behavior needs a hell of a lot more documentation.

This should resolve a long standing memory leak i've known about but been unable to find, back from my old "I'm just going to use GUI becuase this map will never become large enough to make it worth my time to learn jass" times. This one's pretty minor except for long games (in my experience anyway), and doesn't relate to UD issues. But god this one annoyed me for years.

DarnYak

Fierach
Visitor
Visitor
Posts: 35
Joined: July 3rd, 2007, 10:29 pm

Re: EotA--memory leaks out the ass

#27 Post by Fierach »

YAY DARNGOATTHING!
Image

Post Reply