- Joined
- Apr 22, 2007
- Messages
- 1,960
I posted this on wc3campaigns, but due to the inactivity, I haven't gotten many clear replies... so here goes:
I'm not so sure about this, but I suppose I'm trying to figure things out on my own.
I'm guessing that non-nulled handles only link when associated with gamecache. Explanation: not nulling the handle increases the reference counter, and the I2S(H2I()) call in gamecache storage leaks a string for each new handle, since the ID constantly grows. In that case, if your map does not use gamecache at all, you wouldn't need to null local handles.
Is that correct?
I'm not so sure about this, but I suppose I'm trying to figure things out on my own.
I'm guessing that non-nulled handles only link when associated with gamecache. Explanation: not nulling the handle increases the reference counter, and the I2S(H2I()) call in gamecache storage leaks a string for each new handle, since the ID constantly grows. In that case, if your map does not use gamecache at all, you wouldn't need to null local handles.
Is that correct?










) you have to destroy created objects and null their local handles. Because somehow it reserves space for something it doesn't release (no clue why). Furthermore even if you do cleanup like you should, it will still leak a pointer. The wrapping pointer (tombstone pointer like someone mentioned earlier.) leaks, since its memory is never released. It's just an easy, cheap solution to fix dangling pointers. I'm not saying that this is a big issue or something, but still a pointer is always leaked when creating and then destroying an object and nulling its local handle.