Null and Leaks

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
The leaks are basically the same as your GUI leaks (locations, groups etc).

You have to null local variables "pointing" to certain handles. Take units for example; say you create some dummy unit in a local unit variable and adds an expiration timer, the variable will still point towards this unit. Locations are also an example.

Most of these are usually easily avoided by the vast variety of systems available to help making life easier. Any use of local locations can be prevented with a global map-specific location variable that you move whenever needed, other than that usage of real values removes the need to worry about locations.
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
This I am certain of:

Needs to be destroyed:
  • locations
  • rects
  • unit groups
  • player forces
  • effects
  • timers
  • user created triggers

Needs to be nulled:
  • locations
  • rects
  • unit groups
  • player forces
  • effects
  • units
  • timers
  • user created triggers

When something is permanent (like players, triggers, recycled timers or even a caster system's caster), you don't need to null it
 

Sevion

The DIY Ninja
Reaction score
413
JASS:
type agent			    extends     handle // If they extend this, they leak and must be destroyed (with exceptions)

type event              extends     agent  // Events never need to be destroyed unless you need to... but... no one needs to...

type player             extends     agent  // Players, don't destroy them. Just null pointers

type widget             extends     agent  // Also just null

type unit               extends     widget  // Null

type destructable       extends     widget // Null

type item               extends     widget // Null

type ability            extends     agent // Who uses abilities? Null

type buff               extends     ability // In essence, the same as an ability

type force              extends     agent // Destroy and null. Don't use them though, use player arrays!

type group              extends     agent // Destroy and null. Don't use them though, use unit arrays!

type trigger            extends     agent // Destroy and null

type triggercondition   extends     agent // Destroy and null

type triggeraction      extends     handle // Destroy and null

type timer              extends     agent// Destroy and null

type location           extends     agent // Remove and null

type region             extends     agent // Destroy and null

type rect               extends     agent // Destroy and null

type boolexpr           extends     agent // Recycle! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile    :)" loading="lazy" data-shortname=":)" />

type sound              extends     agent // Destroy and Null

type conditionfunc      extends     boolexpr // Recycle! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile    :)" loading="lazy" data-shortname=":)" />

type filterfunc         extends     boolexpr // Recycle! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile    :)" loading="lazy" data-shortname=":)" />

type unitpool           extends     handle

type itempool           extends     handle

type race               extends     handle

type alliancetype       extends     handle

type racepreference     extends     handle

type gamestate          extends     handle

type igamestate         extends     gamestate

type fgamestate         extends     gamestate

type playerstate        extends     handle

type playerscore        extends     handle

type playergameresult   extends     handle

type unitstate          extends     handle

type aidifficulty       extends     handle



type eventid            extends     handle

type gameevent          extends     eventid

type playerevent        extends     eventid

type playerunitevent    extends     eventid

type unitevent          extends     eventid

type limitop            extends     eventid

type widgetevent        extends     eventid

type dialogevent        extends     eventid

type unittype           extends     handle



type gamespeed          extends     handle

type gamedifficulty     extends     handle

type gametype           extends     handle

type mapflag            extends     handle

type mapvisibility      extends     handle

type mapsetting         extends     handle

type mapdensity         extends     handle

type mapcontrol         extends     handle

type playerslotstate    extends     handle

type volumegroup        extends     handle

type camerafield        extends     handle

type camerasetup        extends     handle

type playercolor        extends     handle

type placement          extends     handle

type startlocprio       extends     handle

type raritycontrol      extends     handle

type blendmode          extends     handle

type texmapflags        extends     handle

type effect             extends     agent // Destroy and null

type effecttype         extends     handle

type weathereffect      extends     handle

type terraindeformation extends     handle

type fogstate           extends     handle

type fogmodifier        extends     agent // Destroy and null

type dialog             extends     agent // Destroy and null or recycle!

type button             extends     agent // Destroy and null or recycle!

type quest              extends     agent // Destroy and null

type questitem          extends     agent // Destroy and null

type defeatcondition    extends     agent // Destroy and null? Perhaps recycle? I have never used these

type timerdialog        extends     agent // Destroy and null, could recycle, I bet.

type leaderboard        extends     agent // Destroy and null, or recycle!

type multiboard         extends     agent // Destroy and null, or recycle!

type multiboarditem     extends     agent // Destroy and null, or recycle!

type trackable          extends     agent // There is no destroy <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown    :(" loading="lazy" data-shortname=":(" /> Only can disable their trigger and null the pointers. Unfinished types ftl.

type gamecache          extends     agent // Meh!? You use GC?!?

type version            extends     handle

type itemtype           extends     handle

type texttag            extends     handle

type attacktype         extends     handle

type damagetype         extends     handle

type weapontype         extends     handle

type soundtype          extends     handle

type lightning          extends     handle

type pathingtype        extends     handle

type image              extends     handle

type ubersplat          extends     handle

type hashtable          extends     agent // Recycle. Never destroy these.


Anything that extends agent, generally.
 

Chaos_Knight

New Member
Reaction score
39
This I am certain of:

Needs to be destroyed:
  • locations
  • rects
  • unit groups
  • player forces
  • effects
  • timers
  • user created triggers

Needs to be nulled:
  • locations
  • rects
  • unit groups
  • player forces
  • effects
  • units
  • timers
  • user created triggers

When something is permanent (like players, triggers, recycled timers or even a caster system's caster), you don't need to null it

Thanks, bot you and Sevion. +rep. ;)
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
Don't need to null players
If you use TimerUtils, you also don't need to null timers
 

Viikuna

No Marlo no game.
Reaction score
265
Actually:

locations - you only really need a one location, for GetLocationZ

unit groups - recycle them. no need to null.


timers - recycle. so no need to null

edit.

You basicly have to destroy all [lJASS]handle[/lJASS] objects, that you no longer have any use for.
If you destroy some [lJASS]handle agent[/lJASS] object, you also have to null all variables pointing to it. If there is some variables pointing to it, its handle index wont get recycled.
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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