HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Nulling before Overwriting?

05-18-2008, 11:53 PM#1
dhobby
Is it necessary to clear a variable before overwiting it? For example I usually make a unit group but I sometimes overwrite this variable in the same trigger. Is there no effect or do I have to start nulling them Thanks!
05-19-2008, 01:04 AM#2
Vexorian
The only place in which you arguably need to null something is before a function ends.
05-19-2008, 12:32 PM#3
Anitarf
Quote:
Originally Posted by dhobby
Is it necessary to clear a variable before overwiting it? For example I usually make a unit group but I sometimes overwrite this variable in the same trigger. Is there no effect or do I have to start nulling them
You don't need to null them, you just need to destroy the group.
05-19-2008, 05:47 PM#4
dhobby
thanks

another question - Is it okay for me to leave variables uncleared if i plan to overwrite them in other triggers. (GUI) What is the effect on memory if I do this?

the triggers activate very often and keeps reusing the variables
05-19-2008, 06:36 PM#5
cohadar
Yes reusing variables is very good, no need for nulling than.
Just don't forget to clean leaks.
05-19-2008, 07:06 PM#6
dhobby
thanks. Just what I needed =D