Triggers - Memory Leaks and Custom Scripts

tooltiperror

Super Moderator
Reaction score
231
Animations don`t leak, neither do any strings.

Also, they need to add JASS to this, really.
 

Zanderist

New Member
Reaction score
5
Yes but how was it discovered?

Did someone find them in blizzard's maps?

Did someone from blizzard put a list out?
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
blizzard.j, common.j and iirc a 3rd one, though I don't remember the name...

There is common.ai but those functions aren't accessible unless you have NewGen and use native declarations. They don't have handle destroying functions though, so yeah. :p

Anyway, as said they were found in the common.j and blizzard.j. Except they ultimately end up calling from the common.j, and the standard custom-script-handle-destroying functions for GUI are from the common.j.

Here are a lot of them, probably not all but I was too lazy to look through them all. However, you only need to really use a couple of these except for in specific occasions:
JASS:
native DestroyDefeatCondition           takes defeatcondition whichCondition returns nothing
native DestroyEffect                takes effect whichEffect returns nothing
native DestroyFilter    takes filterfunc f returns nothing
native DestroyFogModifier           takes fogmodifier whichFogModifier returns nothing
native DestroyForce             takes force whichForce returns nothing
native DestroyGroup                         takes group whichGroup returns nothing
native DestroyImage                 takes image whichImage returns nothing
native DestroyItemPool          takes itempool whichItemPool returns nothing
native DestroyLeaderboard               takes leaderboard lb returns nothing
native DestroyLightning             takes lightning whichBolt returns boolean
native DestroyMultiboard                takes multiboard lb returns nothing
native DestroyQuest         takes quest whichQuest returns nothing
native DestroyTextTag               takes texttag t returns nothing
native DestroyTimer         takes timer whichTimer returns nothing
native DestroyTimerDialog               takes timerdialog whichDialog returns nothing
native DestroyTrigger   takes trigger whichTrigger returns nothing
native DestroyUbersplat             takes ubersplat whichSplat returns nothing
native DestroyUnitPool          takes unitpool whichPool returns nothing
native DialogDestroy                takes dialog whichDialog returns nothing
native TriggerRemoveAction  takes trigger whichTrigger, triggeraction whichAction returns nothing
native TriggerRemoveCondition takes trigger whichTrigger, triggercondition whichCondition returns nothing
native RemoveLocation           takes location whichLocation returns nothing
native RemoveRect               takes rect whichRect returns nothing
native RemoveRegion             takes region whichRegion returns nothing


You can view the common.j functions with something like JASSCraft or TESH found in NewGen. They basically have function finders which allow you to find which function you need to use.
 

SanKakU

Member
Reaction score
21
when I use call RemoveLocation (udg_Temp_Point) It won't work it gives an error :(

Line 28: Invalid argument type (rect)
Line 31: Expected a code statement (rect)

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
set udg_Temp_Point = gg_rct_Region_Start
call CreateNUnitsAtLocFacingLocBJ( 1, 'nspr', Player(11), GetRandomLocInRect(udg_Temp_Point), GetUnitLoc(GetTriggerUnit()) )
call RemoveLocation (udg_Temp_Point)
endfunction


I didn't use jass it just gave me that :)

i think this is a very late reply...sorry about that.
anyway...you're confusing points and rects.
a point is something in gui that uses x and y reals.
in other words...you're trying to set your point to be a region, or a rect.
but that's not allowed at all.
0,0 is an example of a point.
0,0,100,100 would be an example of a region.
you can't make a point into a region, you are going to at least need two points to make a region.
 

Kiido

New Member
Reaction score
2
Quick question,

Does using GUI to "Remove (unit) from the game" effectively stop the leak? Or is a custom script needed?
 

Arnaldium

New Member
Reaction score
0
I'm sorry to bump this but I have a question that has been bothering me.

If I'm using multiple times the same point variable, do I have to set it and free it everytime I use it during a code?

such us:

Trigger:
  • Teoria de Cuerdas Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Teoria de Cuerdas
    • Actions
      • Set cuerdM = 50000.00
      • Set cuerda = (Casting unit)
      • Custom script: set bj_wantDestroyGroup=true
      • Set abj_position = (Position of (Triggering unit))
      • Unit Group - Pick every unit in (Units within 600.00 of abj_position matching ((((Owner of (Matching unit)) is an enemy of (Owner of cuerda)) Equal to True) and (((Matching unit) is A Hero) Equal to True))) and do (Actions)
        • Loop - Actions
          • Custom script: call RemoveLocation (udg_abj_position)
          • Set abj_position = (Position of (Triggering unit))
          • Set acj_position = (Position of (Picked unit))
          • Set cuerdD = (Distance between abj_position and acj_position)
          • Custom script: call RemoveLocation (udg_abj_position)
          • Custom script: call RemoveLocation (udg_acj_position)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • cuerdD Less than cuerdM
            • Then - Actions
              • Set cuerdM = cuerdD
              • Set cuerdeado = (Picked unit)
            • Else - Actions
      • Set abj_position = (Position of (Triggering unit))
      • Unit - Create 1 Envenomer for (Owner of (Triggering unit)) at abj_position facing Default building facing degrees
      • Custom script: call RemoveLocation (udg_abj_position)
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add CuerdasSlow to (Last created unit)
      • Unit - Set level of CuerdasSlow for (Last created unit) to (Level of Teoria de Cuerdas for (Triggering unit))
      • Unit - Order (Last created unit) to Human Sorceress - Slow cuerdeado


everytime I used abj_postition is Position of triggering unit but I wasn't sure if I had or not to free it everytime I use it.
It's kinda messy but you see the point

It picks the closest hero and cast a slow based skill on it. It works fine but I was concerned about the leaks, maybe I'm a bit too paranoid.
 

tooltiperror

Super Moderator
Reaction score
231
You only need to remove the leaks once at the end.
 

Massacre

New Member
Reaction score
0
:nuts::confused::banghead:
What do you mean by call DestroyTrigger( GetTriggeringTrigger() )
And What Is ( GetTriggeringTrigger() ) ??
 

tooltiperror

Super Moderator
Reaction score
231
It's what you put in the custom script action.
 

OST(Norway)

New Member
Reaction score
0
Do unit functions like "Last created unit" leave leaks?

Example A:
Action - Unit Group - Add (Last created unit) to (Temp_Unit_Group)

Example B:
Action - Set Variable - Set (Temp_Unit) equal (Last Created Unit)
Action - Unit Group - Add (Temp_Unit) to (Temp_Unit_Group)
Action - Custom Script - Call .........

Is it ok with Ex A or do I have to follow Ex B? In case B, how will the Custom Script look?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol
    +1
  • The Helper The Helper:
    The recipe today is Sloppy Joe Casserole - one of my faves LOL https://www.thehelper.net/threads/sloppy-joe-casserole-with-manwich.193585/
  • The Helper The Helper:
    Decided to put up a healthier type recipe to mix it up - Honey Garlic Shrimp Stir-Fry https://www.thehelper.net/threads/recipe-honey-garlic-shrimp-stir-fry.193595/
  • The Helper The Helper:
    Here is another comfort food favorite - Million Dollar Casserole - https://www.thehelper.net/threads/recipe-million-dollar-casserole.193614/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top