Ayanami
칼리
- Reaction score
- 288
Not sure if this thread belongs in this section. Just wanted to know how an event leak actually occurs.
1. You add an event to a trigger.
2. The event loses relevance (eg. if it's a unit event, and the unit gets removed from the game.)
3. You don't do anything else, and now there's a useless event attached to a trigger taking up memory.
To combat this, use dynamic triggers; supposedly, destroying a trigger destroys its events and conditions, but not its actions. (I'm just going by what I've read that others have reported, and how many systems are coded.)
No, that only dereferences a reference. Handles are references, unlike the basic data types which copy data when set to another variable, references just point to an object in memory, warcraft's scripting engine doesn't automatically dereference local handle type variables, which causes reference leaks, thus the need to null dynamically allocated handle types.No that won't do much the magic thingy is:
local handle h = CreateHandle()
DestroyHandle(h)
h = null // why nulling? -> dunno =)