Tool Leak Check v3

Im_On_56k

Hm...
Reaction score
116
NEW VERSION 3.1
Download it below.


Well I was sitting in my computer class extremely bored with nothing to do, so I decided to remake Leak Check.

For all those who don't know.

Leak Check is a simple program that scans through text to try to find key words that may be a possible leak such as "(Center" which can indicate:
(Center of (Playable Map Area))
Leak Check flags that line and where in that line the leak is and attempts to produce a possible fix to the user.

Older versions of Leak Check required you to paste the trigger you wanted to check into a .txt document. In this new version you directly paste it into the program.

Something you also might notice is that is an extremely small sized program now compared to older versions.

I present you Leak Check v3!.
This version was built from the ground up.

*Leak Check is not 100% accurate in locating and fixing leaks.
*I recommend you to read a Memory Leak Tutorial on this site to help get a better understanding on how leaks work.

Other New Features
Always Copy - When you use the 'copy as text' function in the World Editor or even copy a trigger from a thread on TH it will automatically place that copied text into the program.
Scan on new copy - Relating to Always Copy this will also scan the newly copied text for leaks. These two features are helpful for checking a large amount of triggers or actions.

-Leak Check can scan up to 32,767 lines of code and up to 2,147,483,647 words total in a single scan.

- Please report any leaks that are not being detected if you find any.
leakchecknewSS.jpg


*Latest Leak Definitions*
March 28, 08
 

Darkenneko

TH.net Regular
Reaction score
3
Nice,
From what it looks, it looks clean and works properly,
I'll be defiantly testing a lot out of it with my maps, I had already been for V2.
Thanks for updating a great program, and most likely making it better. =]
-Calvin
 

PurgeandFire

zxcvmkgdfg
Reaction score
509
Yeah, I didn't know you would make another version. Nice. I don't need this much anymore but it is still useful if I ever decide to code in GUI again. :D

Anywho, nice job.
 

SFilip

Gone but not forgotten
Reaction score
634
Care to share the source code?
 

Sil3nt

SUP?
Reaction score
134
Very useful for newbies and lazy people like me. However 1 of my triggers had a location which was not removed (so i could refer to it in another trigger) but the leak check did not detect it. Is it suppose to be like that? Ill pm you the code.

Also why not make it detect player group leaks as well?
 

Im_On_56k

Hm...
Reaction score
116
Very useful for newbies and lazy people like me. However 1 of my triggers had a location which was not removed (so i could refer to it in another trigger) but the leak check did not detect it. Is it suppose to be like that? Ill pm you the code.
The program does not detect whether or not you actually remove the locations and such if you assign them to a variable. It only checks for if you are actually assigning them.

I might make it check whether or not you destroy/remove the leaks instead of if you just assigned them. - That will be in a later version.

Also why not make it detect player group leaks as well?
It should detect player group leaks. I know there isn't a checkbox option for it. If you find any undetected player group leaks please let me know.

Care to share the source code?
Sure thing. Once I finish commenting it I'll post it. This version is made in Visual Basic 6 so I will upload the actual files as well as the code itself for those who don't have VB6.
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
Won't it just lag for quite a long time when checking a 150++ lines of GUI?
 

Somatic

You can change this now in User CP.
Reaction score
84
Welcome Back =)

Nice update on the wonderful program i use to use when coding in GUI =P
 

Trollvottel

never aging title
Reaction score
262
im too lazy to test, what if theres written

move unit to position of someunit offset by 200 towars 50 degrees?

will he fix both location leaks?
 
Reaction score
456
>It is a Tool - if it said System before it has been changed.
But there is no Tool forum or anything similar at all ;s..
 

Im_On_56k

Hm...
Reaction score
116
Won't it just lag for quite a long time when checking a 150++ lines of GUI?
It shouldn't. I did a test of 207 lines finding 57 leaks. The scan took about 5-10 seconds on my computer. After that I did a 2061 line gui code finding 507 leaks. Taking about 30-40 seconds. It might be faster/slower depending on the speed of your computer. Doing another test I scanned 156 lines with 3 placed leaks. It took 2-3 seconds to scan. I did one last test with about 2000 lines finding about 5000 leaks. (each action had multiple leaks) It took 1 minute to finish.
The more leaks you have the longer it will take to scan. The longer code you scan will not make a big difference unless you have an enormous amount of leaks.

move unit to position of someunit offset by 200 towars 50 degrees?
I actually found a small bug doing so.

I used
Code:
Unit - Move (Triggering unit) instantly to ((Position of (Last created unit)) offset by 200.00 towards 50.00 degrees)

A bug in that is there is no suggested fix for the offset and it is not updating the suggested fix. I will be fixing this soon.
The output with the new leak definitions below is:
Code:
(Line: 1) (Word: 7) Location Leak
Unit - Move (Triggering unit) instantly to ((Position of (Last created unit)) offset by 200.00 towards 50.00 degrees)
Unit - Move (Triggering unit) instantly to ^Leak
(Suggested Fix) Set MyLocation = ((Position of (Last created unit)) 
(Suggested Fix) Unit - Move (Triggering unit) instantly to MyLocation offset by 200.00 towards 50.00 degrees)
(Suggested Fix) Custom script:   call RemoveLocation(udg_MyLocation)

(Line: 1) (Word: 12) Location Leak
Unit - Move (Triggering unit) instantly to ((Position of (Last created unit)) offset by 200.00 towards 50.00 degrees)
Unit - Move (Triggering unit) instantly to ((Position of (Last created unit)) ^Leak
(Suggested Fix) No suggested fixes.

To update your leak definitions open LeakDefinitions.txt in the LeakCheck folder and replace the contents with:
Code:
(Center|Location|CheckWord,3,=|area))&map))&bounds))&<gen>)
((Center|Location|a|area))&<gen>)&map))
(Target|Location|NextCheck,point,3,=|order)&cast)
((Random|Location|InString,point|area))&<gen>)&map))
offset|Location|InString,((Center|a
offset|Location|InString,((Random|a
offset|Location|InString,((Position|a
offset|Location|InString,((Target|a
(Random|Location|NextCheck,point,3,=|area))&<gen>)&map))
(Position|Location|CheckWord,3,=|unit))
((Position|Location|a|unit))&structure))&order))&cast))
Create|Special Effect|DestroyEffect,1,Special|a
Create|Lightning|DestroyEffect,1,Lightning|a
(Units|Unit Group|CheckWord,before,=|area))&<gen>)
(Player|Player Group|Next,5,group|a
 

SFilip

Gone but not forgotten
Reaction score
634
> Does this also work for JASS? or vJass?
No, and no.
But NewGen has war3err which allows you to catch leaks at runtime - turn it on in the Grimoire menu (check Start War3 wth Grimoire and Enable war3err in the Grimoire menu) and you should see red game messages when it catches a leak.

Anyway, the only Player Group leak it actually detects is Convert Player To Player Group (ignores all others). It would also be nice if it could detect if the mapper tried to destroy (All players) and warn that it's a very bad idea to do that.

I also recommend that you get rid of the suggested fix thing.
A lot of people completely rely on this fix as the ultimate and only solution while they often don't know how to use it ("where is the Set MyLocation action?") or can sometimes be wrong due to a bug/improper use (in conditions for instance).
Instead you can just make it say, for example, "Unit Group Leak, click here for more info" where clicking would result in a window with information on Unit Group leaks and a couple of examples on how to remove them (and possibly a link to emjlr3's tutorial) showing up.
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
What? :( No colors?
:p With colors, I can see better.
(and prettier)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though

      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