Chaos_Knight
New Member
- Reaction score
- 39
In JASS, vJASS, what variables leaks, and which do i have to null?
Thanks.
//Chaos_Knight
Thanks.
//Chaos_Knight
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 :)" 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 :)" data-shortname=":)" />
type filterfunc extends boolexpr // Recycle! <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" 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 :(" 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.
Thanks, bot you and Sevion. +rep.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
Just a fast question about nothing, How to implent those Templates, Systems?Don't need to null players
If you use TimerUtils, you also don't need to null timers
Okay.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