wtf?
You cannot null an integer or a real.
Integers, reals and strings do not leak.
Only thing you need to worry about is handles.
Local handle variables always need to be nulled if you declare a handle into them. (This is true except for under special circumstances). Some handles even need to be destroyed.
But that's it--don't touch integers or reals.
Avoid Memories leak
Moderator: Cheaters
-
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
-
- Some Honorary Title
- Posts: 1713
- Joined: June 8th, 2007, 5:08 am
- Title: Angry Bird
Re: Avoid Memories leak
I have just tested them. You are right they cant be nulled.
I have no idea how, if unused integers are greater than an X amount, the game will causes a lot of lags and disconnecting.
I was just trying to solve that problem.
W/e, I have solved that problem by using too much integers in a condition situation.
Examples: if integerZ>6 then
If this kind of conditions are greater than an X amount, the game will crashes.
I have no idea.
I have no idea how, if unused integers are greater than an X amount, the game will causes a lot of lags and disconnecting.
I was just trying to solve that problem.
W/e, I have solved that problem by using too much integers in a condition situation.
Examples: if integerZ>6 then
If this kind of conditions are greater than an X amount, the game will crashes.
I have no idea.
-
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
Re: Avoid Memories leak
That's not true at all.initiald wrote:I have just tested them. You are right they cant be nulled.
I have no idea how, if unused integers are greater than an X amount, the game will causes a lot of lags and disconnecting.
Doesn't matter what the value of an integer is, it's not laggy and does not d/c.
The problem is elsewhere.
-
- Forum Staff
- Posts: 926
- Joined: June 3rd, 2007, 8:03 pm
-
- Some Honorary Title
- Posts: 1713
- Joined: June 8th, 2007, 5:08 am
- Title: Angry Bird
Re: Avoid Memories leak
hmm, then it would be loops.
How could loops causes lags and such? How to avoid it?
How could loops causes lags and such? How to avoid it?
-
- Forum Staff
- Posts: 926
- Joined: June 3rd, 2007, 8:03 pm
Re: Avoid Memories leak
well if you make the loop loop too much is a grand way to cause lag you know looking at something 50000 times just cuz ur loop is mean is never fun. To fix this just try to make sure your loop doesn't have to loop too much and make sure you don't mess up and have a never ending loop.

-
- Forum Staff
- Posts: 829
- Joined: January 28th, 2007, 8:10 pm
- Title: JASS Programmer
- Location: Canada
Re: Avoid Memories leak
Infinite loops will cause a lag spike until the game reaches the stack limit in which the loop will stop and the function will just exit.
-
- Some Honorary Title
- Posts: 1713
- Joined: June 8th, 2007, 5:08 am
- Title: Angry Bird
Re: Avoid Memories leak
Let's see if this is true.
set d=0
loop
if SubString(0,d)=="-call" then
call Function (d)
endif
set d=d+1
exitwhen d>5
endloop
I think it's because when the conditions is true, it takes the integer d to the other function.
Since d has been brought to another place, it is not exits in the loop anymore and thus causes an infinite loop. As d would never be >5.
I am not sure.
But what causes server split it some sort of triggers just like above.
set d=0
loop
if SubString(0,d)=="-call" then
call Function (d)
endif
set d=d+1
exitwhen d>5
endloop
I think it's because when the conditions is true, it takes the integer d to the other function.
Since d has been brought to another place, it is not exits in the loop anymore and thus causes an infinite loop. As d would never be >5.
I am not sure.
But what causes server split it some sort of triggers just like above.
-
- Forum Staff
- Posts: 926
- Joined: June 3rd, 2007, 8:03 pm
Re: Avoid Memories leak
d will be greater then 5 in 6 runs of the loop as for what the function Function() does who knows, guess only you. 

-
- Some Honorary Title
- Posts: 1713
- Joined: June 8th, 2007, 5:08 am
- Title: Angry Bird
Re: Avoid Memories leak
Aero, please take a look if these codes still leaks. thanks
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))
call DestroyForce(GetForceOfPlayer(ConvertedPlayer(GetForLoopIndexA())))
call RemoveLocation(GetUnitLoc(udg_heroes[GetForLoopIndexB()]))