HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Would this leak?

06-04-2006, 05:58 PM#1
Soultaker
Hello again..

I'm thinking about some memory leaks, and saw this one.. Would it leak?

Trigger:
Test
Events
Conditions
Collapse Actions
Set temp_point = (Player 1 (Red) start location)
Unit - Create 1 Footman for Player 1 (Red) at temp_point facing Default building facing degrees
Set temp_point = (Player 2 (Blue) start location)
Unit - Create 1 Footman for Player 2 (Blue) at temp_point facing Default building facing degrees
Custom script: call RemoveLocation(udg_temp_point)

Btw. I don't care about the units, the location or whatever.. This is just a question whether using temp_point twice would leak.

- Soultaker
06-04-2006, 06:08 PM#2
Blade.dk
It does, the old object does not disappear because you save another one in the variable. So you must use RemoveLocation before setting the variable again.
06-04-2006, 06:09 PM#3
Soultaker
Quote:
Originally Posted by Blade.dk
It does, the old object does not disappear because you save another one in the variable. So you must use RemoveLocation before setting the variable again.

Thanks, I'll keep that in mind.

- Soultaker