Leak test

--Thanatos--

New Member
Reaction score
33

--Thanatos--

New Member
Reaction score
33
Okay I think I got the answer.

Units don't leak (at least we cannot do any to remove the leak, I've read that somewhere).
But still +rep for Squll2 for that... :D

Then another question:
Is it Efficient enough?
 
Reaction score
333
Use DisableTrigger() and TriggerRemoveAction() before destroying.

Edit: Unfortunately, you can only get a triggeraction when you first register a trigger, so it's best to not use actions entirely and instead put your "actions" in the trigger condition (put return false at the end). This is according to Vexorian.

i believe.. but im only a begineer that

Code:
GetTriggerUnit()

will leak.

Not a "leak" you would want to get rid of though.
 

--Thanatos--

New Member
Reaction score
33
Please destroy triggers.

> Use DisableTrigger() and TriggerRemoveAction() before destroying.

DisableTrigger() is unnecessary (heard from SFilip, if I'm not mistaken).

TriggerRemoveAction? I think TriggerClearActions will do the job?

> Edit: Unfortunately, you can only get a triggeraction when you first register a trigger, so it's best to not use actions entirely and instead put your "actions" in the trigger condition (put return false at the end). This is according to Vexorian.

Oh yeah. I remember that there's the trick.

BTW, this is just a test, so don't care about handle stacks. -.-
 
Reaction score
333
Please destroy triggers.

> Use DisableTrigger() and TriggerRemoveAction() before destroying.

DisableTrigger() is unnecessary (heard from SFilip, if I'm not mistaken).

TriggerRemoveAction? I think TriggerClearActions will do the job?

> Edit: Unfortunately, you can only get a triggeraction when you first register a trigger, so it's best to not use actions entirely and instead put your "actions" in the trigger condition (put return false at the end). This is according to Vexorian.

Oh yeah. I remember that there's the trick.

BTW, this is just a test, so don't care about handle stacks. -.-

If there is a TriggerClearActions then it will probably work just as well as TriggerRemoveAction.
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
No leaks here.

You should know that when destroying trigger (although it appears that it shouldn't be done) you need to disable the trigger before destroying it.
 

Tom Jones

N/A
Reaction score
437
As someone mentioned, you'll have to remove the triggeraction from the trigger before destroying it to avoid leaks. DestroyTrigger() doesn't clean triggeractions from a trigger.
 

emjlr3

Change can be a good thing
Reaction score
395
add a condition as opposed to a triggeraction, and use that in its place. Then destroying the trigger is all that is needed.

As far as efficieny goes, structs would still blow this away
 

Rheias

New Helper (I got over 2000 posts)
Reaction score
232
> Source on this?

I'm unable to find the thread again, however I saw somewhere the removing triggers without disabling them is like removing timers without pausing them, what appears to cause few problems.

Maybe need wasn't the right word, but it certainly won't do harm!

> As someone mentioned, you'll have to remove the triggeraction from the trigger before destroying it to avoid leaks. DestroyTrigger() doesn't clean triggeractions from a trigger.

Or use condition as an action.
 

Dimaspy

New Member
Reaction score
19
Fact about leaks. Nobody likes them, they are in the way, they are irritating, some people has wrecked their computer because of them, and if you don't like the leaks here, never try out Worldcraft making counter-strike maps. :banghead:

( Totally out of topic!! :p )
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
i believe.. but im only a begineer that

Code:
GetTriggerUnit()

will leak.

Units don't leak. Only local units leak, so they need to be set to null. Mapmakers just use variables for GetTriggerUnit() if it is being called a lot of times, so it is easier for them to write some variable name such as "caster" than "GetTriggerUnit()". It is just a time and amount of work efficiency, both will do the same and won't leak. (Except local units because they need to be nulled) :D
 
Reaction score
456
>u need to pause timer before destroying\removing it?
You don't need to, it destroys anyways, but you really should.. I don't remember why >_>

It's also good not to destroy timer you use in spell, you should use same timer for all instances if you are able to.
 

--Thanatos--

New Member
Reaction score
33
I cannot use structs. :( (I don't have NewGen)

> You don't need to, it destroys anyways, but you really should.. I don't remember why >_>
Infinite run bug maybe?

> It's also good not to destroy timer you use in spell, you should use same timer for all instances if you are able to.
Freaking hard w/o globals. -.-

> You should know that when destroying trigger (although it appears that it shouldn't be done) you need to disable the trigger before destroying it.
I don't think so. I remember a mod told me. (forgotten, SFilip if I'm not mistaken)
 

SFilip

Gone but not forgotten
Reaction score
634
> at least we cannot do any to remove the leak, I've read that somewhere
Not true.
A leak only occurs when you create something and don't destroy. Units get destroyed about 90 seconds after death.
GetTriggerUnit does not create anything...and, well, why would someone want to create a unit every 0.1 seconds? Unless it's invisible (dummy) there should be nothing to worry about.

> could u elaborate this one?
Supposedly there is a cached "list" of all handles.
Now recently we figured that I2H based systems tend to corrupt it - warcraft can't understand when a handle simply appears out of nowhere.
When this happens handles you create afterwards might get the same id as some existing...very bad thing really.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top