• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Does boolexpr leak?

Status
Not open for further replies.
Level 11
Joined
May 29, 2008
Messages
132
The boolexpr extends the handle type, so yes, boolexpr leak (see common.j:23 for boolexpr type declaration). That said, it's not that big of a deal because most maps don't create that many boolexprs, so leaking them is just fine.

If your map creates >100,000 boolexpr during the average game, it may be a leak source to be concerned with.
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
The boolexpr extends the handle type, so yes, boolexpr leak (see common.j:23 for boolexpr type declaration). That said, it's not that big of a deal because most maps don't create that many boolexprs, so leaking them is just fine.

If your map creates >100,000 boolexpr during the average game, it may be a leak source to be concerned with.
But how leak?, just for reference or also if I did
JASS:
local boolexpr b=Condition(function this)
and then I have to destroy it?
 
Level 11
Joined
May 29, 2008
Messages
132
Anything that extends handle needs to be explicitly destroyed when no longer needed, otherwise it leaks. Note that "When no longer needed" is very important and can be subtle. For example, if you used `b` in in your code above as a condition in a trigger, then destroyed b, the trigger would not work. You destroyed `b` when the trigger was still using it.

But again, leaks aren't that big of a deal. There's a number of leaks that are just part of the WC3 engine that don't cause issues in the average game. In general, just worry about the common leaks, like points, groups and the like, unless you start seeing actual issues in map performance.
 
Level 24
Joined
Jun 26, 2020
Messages
1,852
Anything that extends handle needs to be explicitly destroyed when no longer needed, otherwise it leaks. Note that "When no longer needed" is very important and can be subtle. For example, if you used `b` in in your code above as a condition in a trigger, then destroyed b, the trigger would not work. You destroyed `b` when the trigger was still using it.

But again, leaks aren't that big of a deal. There's a number of leaks that are just part of the WC3 engine that don't cause issues in the average game. In general, just worry about the common leaks, like points, groups and the like, unless you start seeing actual issues in map performance.
Well, ok.
 
Status
Not open for further replies.
Top