The two major leaks: Groups and locations (bleg, Points in GUI, but location sounds better x.x)
Soo... for Points, it's really easy. Just create a location variable, and call it something. I like to use loc or TempPoint (erm, well, when I used locations that is >_>)
Now that we have TempPoint, find every place you're using a location. Note: if you use the same location twice in a row, you don't need to destroy it and readd it as shown here. Only destroy the location when you're done with it, and readd it if you need to clean a different one.
Eg:
Unit - Create 1 unit at (Center of (Playable Map Area))
Center of Playable Map Area is a location and is leaking. To fix this, we assign it to a variable, then clean it up
Set TempPoint = (Center of (Playable Map Area))
Unit - Create 1 unit at TempPoint
Custom script: call RemoveLocation( udg_TempPoint )
Notice how udg_ is added to the start of the 'global' variable.
If we were to create another unit at the center of the map, we could use it again before destroying it, but if we wanted to change where to create the unit, we would have to re-create TempPoint after the RemoveLocation.
So, later on, a simple trigger may be fixed up to look like:
Set TempPoint = (Center of (Playable Map Area))
Unit - Create 1 unit at TempPoint
Unit - Create 1 other unit at TempPoint
Custom script: call RemoveLocation( udg_TempPoint )
Set TempPoint = (Player 1 (Red) Start Location)
Unit - Create 1 other other unit at TempPoint
Custom script: call RemoveLocation( udg_TempPoint )
Groups are even easier. There are 2 ways you can pick to do it.
Way 1:
Find every Unit Group which doesn't use a variable (if it's stored in a variable, you're probably using it later, and then we can destroy it later). Add this line before them:
Custom script: set bj_wantDestroyGroup = true
That's it. No fuss. No hassle.
Way 2:
Same steps as how to clear locations, but with a group variable. The remove line is:
Custom script: call DestroyGroup(udg_TempGroup)
or whatever other group variable name you used, prefixed by udg_ as always.