• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Leaks

Level 7
Joined
Nov 15, 2009
Messages
225
What are leaks?
Just a little bit 'different' explaining for all those who don't understand it.

I will explain it with an example.


1. Imagine a variable is a memo.

You can save data with a variable.
So in this example you write a value down on a memo.

2. How to check the value?

Simply pick up the memo and read what you've written down.
Any problems so far? No? Fine, let's continue!

3. I want to write down something else

How could you do this?
Strike the previous text and write down something else.
So we have an unreadable text (striked text) and another text you can read.

In our example the striked text is the leak.
It is still there, but you can't read it (even when you know what it is).

4. How can we avoid this leak?

Get a new memo for every text you write down.
And don't forget to throw the old memo into your bin.
This means that a variable would be removed, destroyed or 'null'ed now.

5. Does any variable leaks?

Thanks god no, but it would be easier to remember if they all would.
There's the problem. How should you know what leaks?
Don't worry, you will learn this over time (even if you don't focuse on it).

Most common things that leak:

locations
unit groups (groups)
player groups (forces)
special effects

6. How can I avoid leaks?

If you already used Jass it's not that problem. Because removing leaks mostly needs jass scripts.
As a GUI user (warcraft dialog triggering) you need custom scripts (listed somewhere on the top of all).
Inside those custom scripts you can write down any jass line you want.
In this case the 'leak remover'

Methods for most common things that leak
  • Custom script: call RemoveLocation(udg_POINT_VARIABLENAME)
  • Custom script: set bj_wantDestroyGroup = true
  • Player - Clear PLAYERGROUP_VARIABLENAME
  • Special Effect - Destroy(GetLastCreatedEffect)

7. Is there a complete list of things, or additional infos?

Yes, take a look here.
This page helped me a lot!



Remember:
This info does not contains all infos for leaks.
It is just a short explaining!
Last edited:
Top