• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • It's time for the first HD Modeling Contest of 2025. Join the theme discussion for Hive's HD Modeling Contest #7! Click here to post your idea!

Do Regions Leak?

Status
Not open for further replies.
As far as I know, nope directly.

But check this:
Types of Memory Leaks:

- Points: These are the most dangerous when making spells and movement systems with keyboard. Whenever you use the position of an object or a point of a region (Whether it be random or center), and even coordinates, they create a memory leak.
- Groups: Also a common leak, whenever you use "Unit-Group - Pick every unit..." (Also Player and Destructible etc) and you do not use a variable as the group, it will leak.
- Regions: Converting a point with a size to a region, or anything that creates an 'area' without using a region (or preset) will create a memory leak.
- Special Effects: If you do not remove a special effect (Done through a trigger, spells do not leak) it will leak. Even if the spell is finished, the data is still there.
- Strings: Strings are very minor, as they are reused. Once you use "Hi" as a string, every time you use "Hi" it uses the same data, it will not leak... but if you display random messeges (Tips that are preset are fine) it might add up, but probrably not...
Oh and script should look like this:
  • Custom script: call RemoveRect(udg_Your_Variable)
 
I hope you understand what leak really is. Things that leak.

Mostly regions are created to refer to them mupltiple times - in this case don't remove them.

If you are using region dynamicaly to 'scan' area around followed with actions - it's better to create one region at Map Initialization and use function:
  • Custom script: call MoveRectTo(udg_rect, udg_X, udg_Y)
To help you whenever you need the region for performing actions. Variables: 'rect' is declared region variable and X & Y are new coordinates for region's center.

^This allows you to use 1 region for all game long, without spamming create region.
 
Status
Not open for further replies.
Top