• 🏆 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!

[System] Automatic Memory Leak Destroyer

Status
Not open for further replies.
Level 17
Joined
Apr 27, 2008
Messages
2,455
I think Element Of Water want to mean that :

JASS:
private function ASE takes location where, string modelName returns nothing
        //! runtextmacro CatchLocation("where")
        //! runtextmacro CatchEffect("GetLastCreatedEffectBJ()")
endfunction

instead of that :

JASS:
private function ASE takes location where, string modelName returns nothing
        call CatchLocation(where)
        call CatchEffect(GetLastCreatedEffectBJ())
endfunction

But hooks are already .evaluated, it's not a simple call of function, which is slower, so in this case i dunno if it really does matter if you use inline the functions with textmacros or call them.
 
Level 6
Joined
Aug 13, 2009
Messages
197
This discussion is making me sick... really... I'm totally inside the opinion that this is a great system, GUIers often are too lazy to fix all memory leaks and this script cleans them very fast and without troubles, also saves me a lot of painful work. MapperMalte I must congratulate you because you made the most useful system I ever seen (in my opinion).

Thank you very much.

PS: I'm using it on my map and it dealt no damage to my GUI or JASS, for JASS scripters this system may look stupid but for GUIers it's useful.
 
Level 6
Joined
Jul 2, 2008
Messages
156
Gotta love the 4 page nerd fight.
Next time keep the useless banter for PMs and leave room for other comments on the program, please!

And FYI being a GUI user isn't always because your lazy.
As appealing as JASS was to me, it looked like brain melting jibberish until I took a class in C++. I had no idea what a memory leak was (other than being a flaw) or the difference between local and global variables.

And remember, many of the most historic games for Warcraft III were made in GUI, not JASS.

Examples: DoTA (initially), Footmen Frenzy, Wintermaul Wars, LoAP, NoTD (initially), etc.

JASS can be intimidating, and may snuff out a person's inspiration.
 
Level 6
Joined
Sep 19, 2005
Messages
169
When I try to protect some integer variables via call ProtectVariable(xxxx), jasshelper comes up with an error saying "cannot convert integer to handle"
Does this mean that I can't stop your system from deleting the information from my integer variables? Or are the integer variables safe, thus theres no reason to try and protect them?

>>Nevermind<<
 
Level 11
Joined
Apr 29, 2007
Messages
826
Yeah, BJs are evil! They are the reason for leaks!
And replacing BJs wont make code useless that uses things like last created unit!
Dude, no matter if you use BJs or not.

lol. It's known that BJ's are in fact slower than using natives. Why would u need last created unit? Just store it in a varaible yourself if you really need it.
The only thing where I actually use BJ's are those multiboard thingies where you don't really have an alternative.
 
Level 8
Joined
Jun 28, 2008
Messages
356
This is really useful, altho, who uses GUI for big projects now? I mean, after I learned JASS I stopped coding in GUI at all. No matter how simple the triggers are. But for example I had some old maps and projects that were in GUI and were leaking hard. And instead of bashing my head against the wall for hours I can just add this and everything is fixed. This "garbage system" is one of the most useful things on this site, come on guys, you can't say it's useless and stupid.
 
Level 7
Joined
May 23, 2011
Messages
179
I think theres a problem in your Script:
JASS:
    hook ForGroupBJ MemoryLeakHelper__FG // :D This should catch all GUI usages for groups.
    //hook ForGroup FG
    hook GroupPickRandomUnit CatchGroup
    hook CountUnitsInGroup CatchGroup
Its says it cannot Find the Function "CatchGroup" can you help me with this.
:goblin_good_job::goblin_good_job::goblin_good_job:
You are good Jass maker friend.....
 

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
I'm still wondering if using such script provides more good or either kills the intelligence and responibility of user.

Is it so hard to destroy/remove leaks and write your OWN clear code? Even if you have troubles with that, with time you gonna learn it for sure. Making your script buggy, leaving everything for such stuff isn't good habbit and won't help you in future scripting.
 
This isn't useful. Anyone who uses vJass should know how to clear the leaks himself. Plus, in vJass, we don't have to worry about leaks.
We don't use locations (Except for a static one to find the Z of a point)
We don't use dynamic groups anymore. (Static ones for enumeration and FirstOfGroup loops to iterate)
We can easily clear special effects.

GUIers wouldn't use this.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Well there is also the fact that this has a bigger learning curve than actually doing what you're supposed to with groups, locations, special effects, etc. by just removing them yourself.

It also adds a huge sum of KB size to your map. And makes everything perform a lot more slowly. Especially when you are adding a lot of effects on a rapid timer, or are a GUI user using lots of locations/groups per 0.03 seconds.

It requires NewGen and most people are strictly-WE users.

Why did this get approved in the first place. Just because it's "cool" that someone could do it? A JASS garbage collector is not practical unless it's built-in to the source code which Blizzard has made a point they have no intention of doing (demonstrated via the "bj_wantDestroyGroup variable").
 
I don't know why this discussion about the legitimacy of garbage collectors is brought here? It's totally pointless. This thread is not about why this script should be useful or not. It's about the system itself. And it seems to work good, aside from some minor stuff that was already mentioned and fixed.

So far, there is no reason for me to think that this system should not be useful. Sure, Jassers won't need it and good GUI users shouldn't use it too ... and others suck at mapping anyway, but that doesn't matter. The system works and does what it is supposed to do. Wether you would use it or not doesn't matter.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
You are right, Zwiebelchen, if I were to say that practical usefulness is not a requirement for approval. In the Spells section if it is not useful we can just rate it low, but in the JASS section there isn't really such a system. That's one of the reasons I had been trying to push to merge the two sections but no one else seems to show interest in it.
 
Status
Not open for further replies.
Top