Avoid Memories leak

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Avoid Memories leak

Post by Aero »

Yes, that leaks bad.

Code: Select all

call PingMinimapLocForForceEx(GetForceOfPlayer(ConvertedPlayer(GetForLoopIndexA())),GetUnitLoc(udg_heroes[GetForLoopIndexB()]),2.00,bj_MINIMAPPINGSTYLE_SIMPLE,(udg_cred[GetForLoopIndexB()]/2.56),(udg_cgreen[GetForLoopIndexB()]/2.56),(udg_cblue[GetForLoopIndexB()]/2.56))
This leaks twice every time the it runs.

Your "memory cleanup" is not really cleaning up anything.
All it's doing is creating new locations/forces then destroying them right away.
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Avoid Memories leak

Post by initialD »

All right. How about this?

Code: Select all

function Trig_Radar_Hack_Actions takes nothing returns nothing
local force fo7=GetForceOfPlayer(ConvertedPlayer(GetForLoopIndexA()))
local location lo7=GetUnitLoc(udg_heroes[GetForLoopIndexB()])

call PingMinimapLocForForceEx(fo7,lo7,2.00,bj_MINIMAPPINGSTYLE_SIMPLE,(udg_credGetForLoopIndexB()]/2.56),(udg_cgreen[GetForLoopIndexB()]/2.56),(udg_cblue[GetForLoopIndexB()]/2.56))

call DestroyForce(fo7)
call RemoveLocation(lo7)

set fo7=null
set lo7=null
endfunction
ops, it was GUI based codes taken from SG_guy's pack, just trying to fix this.

I think Hear Enemy chat is leaking too, even though it's not as much as the pingminimap thingie.

call DisplayTimedTextToForce(GetForceOfPlayer(ConvertedPlayer(GetForLoopIndexA())),10.00,("[Enemy] "+((udg_cstring[GetConvertedPlayerId(GetTriggerPlayer())]+(GetPlayerName(GetTriggerPlayer())+"|R"))+(" : "+GetEventPlayerChatString()))))

Honestly I have no idea how to fix it, since it doesn't leak a handle. It leaks strings?
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Avoid Memories leak

Post by Aero »

Force leak.

Strings don't leak BUT displaying text to player WILL leak permanently (But it's small).
User avatar
Ozzapoo
The Flying Cow!
Posts: 2196
Joined: November 2nd, 2007, 10:34 pm
Location: Melbourne

Re: Avoid Memories leak

Post by Ozzapoo »

Aero wrote:Force leak.

Strings don't leak BUT displaying text to player WILL leak permanently (But it's small).
Forgive me for sounding 100% n00blet, but I'm not good with terminology... What does 'leak' mean.?
Visit Ozzapoo.net, my blog and the home of AutoCP and Cheatpack Detector!
AutoCP3 now available for free!
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Avoid Memories leak

Post by initialD »

allright, got it.
thanks.

leaks means some momeries are gone forever, if the memory keep leaking, such as xantan's pack, :p, you would be laggy as hell.

Actually what's causes server split?
Last time I have a substring calling a BJ function it dc'ed everyone, until I removed the BJ function.
what is actually happening? why doesn, SubstringBJ or Substring matter?

Examples:
elseif SubString(s7,0,3)=="sp."then
call ModifyHeroSkillPoints()
It dc'ed everyone

but
elseif SubStringBJ(s7,1,3)BJ=="sp."then
call ModifyHeroSkillPoints()
Doesn't dc'ed everyone.

and
elseif SubString(s7,0,3)=="sp."then
call UnitModifySkillPoints(u7,z7-GetHeroSkillPoints(u7))
is fine too.

Once I put all conditions "if" and "elseif" in a row, also caused every dc'ed.
What is the max numbers of condition "if"?



w/e

Do you think this will causes server split?:
Aero, I have tested them on single player with AI map, they works.
Somehow I scared they would causes server split.
Spoiler:
function mhr takes integer bj_forLoopAIndex,integer bj_forLoopBIndex returns nothing
local force fo7=GetForceOfPlayer(ConvertedPlayer(GetForLoopIndexA()))
local location lo7=GetUnitLoc(udg_heroes[GetForLoopIndexB()])
call PingMinimapLocForForceEx(fo7,lo7,2.00,bj_MINIMAPPINGSTYLE_SIMPLE,(udg_cred[GetForLoopIndexB()]/2.56),(udg_cgreen[GetForLoopIndexB()]/2.56),(udg_cblue[GetForLoopIndexB()]/2.56))
call DestroyForce(fo7)
call RemoveLocation(lo7)
set fo7=null
set lo7=null
endfunction
function Trig_Radar_Hack_Actions takes nothing returns nothing
set bj_forLoopAIndex=2
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set bj_forLoopBIndex=8
set bj_forLoopBIndexEnd=12
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
if(Trig_Radar_Hack_Func001003003001())then
call mhr(bj_forLoopAIndex,bj_forLoopBIndex)
else
call DoNothing()
endif
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
set bj_forLoopAIndex=8
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
set bj_forLoopBIndex=2
set bj_forLoopBIndexEnd=6
loop
exitwhen bj_forLoopBIndex>bj_forLoopBIndexEnd
if(Trig_Radar_Hack_Func002003003001())then
call mhr(bj_forLoopAIndex,bj_forLoopBIndex)
else
call DoNothing()
endif
set bj_forLoopBIndex=bj_forLoopBIndex+1
endloop
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endfunction
Spoiler:
function hec takes integer bj_forLoopAIndex returns nothing
local force Fo7=GetForceOfPlayer(ConvertedPlayer(GetForLoopIndexA()))
call DisplayTimedTextToForce(Fo7,10.00,("[Enemy] "+((udg_cstring[GetConvertedPlayerId(GetTriggerPlayer())]+(GetPlayerName(GetTriggerPlayer())+"|R"))+(" : "+GetEventPlayerChatString()))))
call DestroyForce(Fo7)
set Fo7=null
endfunction
function Trig_Chat_Hack_Actions takes nothing returns nothing
if(Trig_Chat_Hack_Func001001())then
set bj_forLoopAIndex=2
set bj_forLoopAIndexEnd=6
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(Trig_Chat_Hack_Func001002003001())then
call hec(bj_forLoopAIndex)
else
call DoNothing()
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
else
set bj_forLoopAIndex=8
set bj_forLoopAIndexEnd=12
loop
exitwhen bj_forLoopAIndex>bj_forLoopAIndexEnd
if(Trig_Chat_Hack_Func001003003001())then
call hec(bj_forLoopAIndex)
else
call DoNothing()
endif
set bj_forLoopAIndex=bj_forLoopAIndex+1
endloop
endif
endfunction

Edit: All right , fixed the descync problem. Still haven't know what i did wrong, probably just some mistakes when I was doing the copy paste job. I found that the descyn script had 1kb missing, that's the problem.
lol
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Avoid Memories leak

Post by initialD »

Hm, Aero, will trigger leaks?
I mean, if someone activate -nocd and didn't close it till the game ends.
Since the trigger has not been destroyed, will it leak?
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Avoid Memories leak

Post by Aero »

Yes, triggers will leak if not destroyed--but when you close the game, the allocated RAM is cleared anyways. This is why people reboot wc3 between games.
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Avoid Memories leak

Post by initialD »

about the -tele command you mentioned.
you told me to put the condition in another function in stead of with the action.

function SomeCond takes nothing returns boolean
return GetIssuedOrderId()==851990
endfunction

In this case, I would need to call a triggeraddcondition.

Could you explain why is this better than just putting the condition with the action?
Will it lag less or leak less if the condition in another function?
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Avoid Memories leak

Post by Aero »

It's cleaner and more effiicient (I would imagine).
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Avoid Memories leak

Post by weirdone2 »

initiald wrote:about the -tele command you mentioned.
you told me to put the condition in another function in stead of with the action.

function SomeCond takes nothing returns boolean
return GetIssuedOrderId()==851990
endfunction

In this case, I would need to call a triggeraddcondition.

Could you explain why is this better than just putting the condition with the action?
Will it lag less or leak less if the condition in another function?
Using my tele function are you. :P Anyway it doesn't matter if you have it in a condition or not, condition = takes up a little more space but the locals won't be set when you issue any point order cmd. No condition = less space but will set a few locals when you give a point order. Adding a condition is only really useful when you have like 10+ locals in a single function.