- Joined
- Apr 16, 2007
- Messages
- 177
What is it?
This is a library that fixes Group/Force/Lightning/Location leaks!
The Key is that stuff will be put on a "remove-this list" once it has been used by a BJ/native in the map (all GUI functions not introduced by EGUI are such functions)...
That list will be cleared every n (default:20) seconds.
What is so special about this?
Your code will be slightly slower, but you will no longer need to care about leak removal!
In the beta, Location, Group, Force and Lightning leaks will be fixed every 20 seconds...
In the testmap, that will happen every 2 seconds so you can actually see it happen.
Requires?
JassPack NewGen
How to import?
Just import this code in a custom script section of your map.
How to use?
It does all by itself.
UNLESS you want to keep Locations / Groups!
"call MakeHandlePermanent( udg_VarName, true)"
The Code
This is just for looking at! If you want to import the code into your map, I suggest using the attached txt file!
Special Thanks
Vexorian... hook is awesome.
The SciTe developers & the ruby interpreter
The internet
Q&A
Q: Does this work with EGUI?
A: Well... Not all leaks might be removed...
Q: Cannot I just use EGUI?
A: EGUI does not automatically remove memory leaks.
Q: Does this make GUIers lazy?
A: No. It just makes them productive and more creative.
Q: Is this slow?
A: Well... It's slower than removing stuff manuable, but faster than not removing it at all.
Q: Does this leak?
A: You get leaks if you just create Locations without using them.
Q: How do I install this?
A: Press Alt-F4. That will automatically install all files needed. Alternatively, read the thread.
This is a library that fixes Group/Force/Lightning/Location leaks!
The Key is that stuff will be put on a "remove-this list" once it has been used by a BJ/native in the map (all GUI functions not introduced by EGUI are such functions)...
That list will be cleared every n (default:20) seconds.
What is so special about this?
Your code will be slightly slower, but you will no longer need to care about leak removal!
In the beta, Location, Group, Force and Lightning leaks will be fixed every 20 seconds...
In the testmap, that will happen every 2 seconds so you can actually see it happen.
Requires?
JassPack NewGen
How to import?
Just import this code in a custom script section of your map.
How to use?
It does all by itself.
UNLESS you want to keep Locations / Groups!
"call MakeHandlePermanent( udg_VarName, true)"
The Code
This is just for looking at! If you want to import the code into your map, I suggest using the attached txt file!
JASS:
library LeakLess initializer INIT
globals
private constant real CLEAN_INTERVAL = 20 // Decides how often leaks will be fixed.
boolean FixLeaks = true // Whether locations and groups are created temporary or not.
private constant trigger LeakFixTrigger = CreateTrigger()
private constant hashtable SecureTable = InitHashtable()
private constant integer ON_LIST = 0
private constant integer SAFE = 1
endglobals
//! textmacro LeakFix_Cleaner takes TYPE, DESTROYER
globals
private integer Index = -1
private $TYPE$ array Data
private boolean Initialized = false
endglobals
private function CleanHandles takes nothing returns nothing
local $TYPE$ h
loop
exitwhen Index == -1
set h = Data[ Index ]
call SetHandle( h, ON_LIST, false )
if not IsHandle( h, SAFE ) then
call $DESTROYER$( h )
endif
set Index = Index - 1
endloop
set h = null
endfunction
private function Write takes $TYPE$ data returns nothing
if not Initialized then
set Initialized = true
call TriggerAddAction( LeakFixTrigger, function CleanHandles )
endif
if not ( IsHandle( data, ON_LIST ) or IsHandle( data, SAFE ) ) then
set Index = Index + 1
set Data[ Index ] = data
call SetHandle( data, ON_LIST, true )
endif
endfunction
//! endtextmacro
private function IsHandle takes handle h, integer what returns boolean
return LoadBoolean( SecureTable, GetHandleId( h ), what )
endfunction
private function SetHandle takes handle h, integer what, boolean is returns nothing
call SaveBoolean( SecureTable, GetHandleId( h ), what, is )
endfunction
function MakeHandlePermanent takes handle h, boolean is returns nothing
call SetHandle( h, SAFE, is )
endfunction
private function INIT takes nothing returns nothing
call TriggerRegisterTimerEvent( LeakFixTrigger, CLEAN_INTERVAL, true )
endfunction
//-------------------- location --------------------
scope LocationLeakFix
//! runtextmacro LeakFix_Cleaner( "location", "RemoveLocation" )
// Please enter functions that create the type here.
private function FixAddLightningLocLeaks takes string codeName, location where1, location where2 returns nothing
call Write( where1 )
call Write( where2 )
endfunction
hook AddLightningLoc FixAddLightningLocLeaks
private function FixAddSpecialEffectLocLeaks takes string modelName, location where returns nothing
call Write( where )
endfunction
hook AddSpecialEffectLoc FixAddSpecialEffectLocLeaks
private function FixAddSpecialEffectLocBJLeaks takes location where, string modelName returns nothing
call Write( where )
endfunction
hook AddSpecialEffectLocBJ FixAddSpecialEffectLocBJLeaks
private function FixAddSpellEffectByIdLocLeaks takes integer abilityId, effecttype t, location where returns nothing
call Write( where )
endfunction
hook AddSpellEffectByIdLoc FixAddSpellEffectByIdLocLeaks
private function FixAddSpellEffectLocLeaks takes string abilityString, effecttype t, location where returns nothing
call Write( where )
endfunction
hook AddSpellEffectLoc FixAddSpellEffectLocLeaks
private function FixAngleBetweenPointsLeaks takes location locA, location locB returns nothing
call Write( locA )
call Write( locB )
endfunction
hook AngleBetweenPoints FixAngleBetweenPointsLeaks
private function FixCompareLocationsBJLeaks takes location A, location B returns nothing
call Write( A )
call Write( B )
endfunction
hook CompareLocationsBJ FixCompareLocationsBJLeaks
private function FixCreateCorpseLocBJLeaks takes integer unitid, player whichPlayer, location loc returns nothing
call Write( loc )
endfunction
hook CreateCorpseLocBJ FixCreateCorpseLocBJLeaks
private function FixCreateDeadDestructableLocBJLeaks takes integer objectid, location loc, real facing, real scale, integer variation returns nothing
call Write( loc )
endfunction
hook CreateDeadDestructableLocBJ FixCreateDeadDestructableLocBJLeaks
private function FixCreateDestructableLocLeaks takes integer objectid, location loc, real facing, real scale, integer variation returns nothing
call Write( loc )
endfunction
hook CreateDestructableLoc FixCreateDestructableLocLeaks
private function FixCreateFogModifierRadiusLocLeaks takes player forWhichPlayer, fogstate whichState, location center, real radius, boolean useSharedVision, boolean afterUnits returns nothing
call Write( center )
endfunction
hook CreateFogModifierRadiusLoc FixCreateFogModifierRadiusLocLeaks
private function FixCreateFogModifierRadiusLocBJLeaks takes boolean enabled, player whichPlayer, fogstate whichFogState, location center, real radius returns nothing
call Write( center )
endfunction
hook CreateFogModifierRadiusLocBJ FixCreateFogModifierRadiusLocBJLeaks
private function FixCreateFogModifierRadiusLocSimpleLeaks takes player whichPlayer, fogstate whichFogState, location center, real radius, boolean afterUnits returns nothing
call Write( center )
endfunction
hook CreateFogModifierRadiusLocSimple FixCreateFogModifierRadiusLocSimpleLeaks
private function FixCreateImageBJLeaks takes string file, real size, location where, real zOffset, integer imageType returns nothing
call Write( where )
endfunction
hook CreateImageBJ FixCreateImageBJLeaks
private function FixCreateItemLocLeaks takes integer itemId, location loc returns nothing
call Write( loc )
endfunction
hook CreateItemLoc FixCreateItemLocLeaks
private function FixCreateNUnitsAtLocLeaks takes integer count, integer unitId, player whichPlayer, location loc, real face returns nothing
call Write( loc )
endfunction
hook CreateNUnitsAtLoc FixCreateNUnitsAtLocLeaks
private function FixCreateNUnitsAtLocFacingLocBJLeaks takes integer count, integer unitId, player whichPlayer, location loc, location lookAt returns nothing
call Write( loc )
call Write( lookAt )
endfunction
hook CreateNUnitsAtLocFacingLocBJ FixCreateNUnitsAtLocFacingLocBJLeaks
private function FixCreatePermanentCorpseLocBJLeaks takes integer style, integer unitid, player whichPlayer, location loc, real facing returns nothing
call Write( loc )
endfunction
hook CreatePermanentCorpseLocBJ FixCreatePermanentCorpseLocBJLeaks
private function FixCreateTextTagLocBJLeaks takes string s, location loc, real zOffset, real size, real red, real green, real blue, real transparency returns nothing
call Write( loc )
endfunction
hook CreateTextTagLocBJ FixCreateTextTagLocBJLeaks
private function FixCreateUbersplatBJLeaks takes location where, string name, real red, real green, real blue, real alpha, boolean forcePaused, boolean noBirthTime returns nothing
call Write( where )
endfunction
hook CreateUbersplatBJ FixCreateUbersplatBJLeaks
private function FixCreateUnitAtLocLeaks takes player id, integer unitid, location whichLocation, real face returns nothing
call Write( whichLocation )
endfunction
hook CreateUnitAtLoc FixCreateUnitAtLocLeaks
private function FixCreateUnitAtLocByNameLeaks takes player id, string unitname, location whichLocation, real face returns nothing
call Write( whichLocation )
endfunction
hook CreateUnitAtLocByName FixCreateUnitAtLocByNameLeaks
private function FixCreateUnitAtLocSaveLastLeaks takes player id, integer unitid, location loc, real face returns nothing
call Write( loc )
endfunction
hook CreateUnitAtLocSaveLast FixCreateUnitAtLocSaveLastLeaks
private function FixDefineStartLocationLocLeaks takes integer whichStartLoc, location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook DefineStartLocationLoc FixDefineStartLocationLocLeaks
private function FixDistanceBetweenPointsLeaks takes location locA, location locB returns nothing
call Write( locA )
call Write( locB )
endfunction
hook DistanceBetweenPoints FixDistanceBetweenPointsLeaks
private function FixEnumDestructablesInCircleBJLeaks takes real radius, location loc, code actionFunc returns nothing
call Write( loc )
endfunction
hook EnumDestructablesInCircleBJ FixEnumDestructablesInCircleBJLeaks
private function FixGetLocationXLeaks takes location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook GetLocationX FixGetLocationXLeaks
private function FixGetLocationYLeaks takes location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook GetLocationY FixGetLocationYLeaks
private function FixGetLocationZLeaks takes location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook GetLocationZ FixGetLocationZLeaks
private function FixGetRectFromCircleBJLeaks takes location center, real radius returns nothing
call Write( center )
endfunction
hook GetRectFromCircleBJ FixGetRectFromCircleBJLeaks
private function FixGetTerrainCliffLevelBJLeaks takes location where returns nothing
call Write( where )
endfunction
hook GetTerrainCliffLevelBJ FixGetTerrainCliffLevelBJLeaks
private function FixGetTerrainTypeBJLeaks takes location where returns nothing
call Write( where )
endfunction
hook GetTerrainTypeBJ FixGetTerrainTypeBJLeaks
private function FixGetTerrainVarianceBJLeaks takes location where returns nothing
call Write( where )
endfunction
hook GetTerrainVarianceBJ FixGetTerrainVarianceBJLeaks
private function FixGetUnitsInRangeOfLocAllLeaks takes real radius, location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook GetUnitsInRangeOfLocAll FixGetUnitsInRangeOfLocAllLeaks
private function FixGetUnitsInRangeOfLocMatchingLeaks takes real radius, location whichLocation, boolexpr filter returns nothing
call Write( whichLocation )
endfunction
hook GetUnitsInRangeOfLocMatching FixGetUnitsInRangeOfLocMatchingLeaks
private function FixGroupEnumUnitsInRangeOfLocLeaks takes group whichGroup, location whichLocation, real radius, boolexpr filter returns nothing
call Write( whichLocation )
endfunction
hook GroupEnumUnitsInRangeOfLoc FixGroupEnumUnitsInRangeOfLocLeaks
private function FixGroupEnumUnitsInRangeOfLocCountedLeaks takes group whichGroup, location whichLocation, real radius, boolexpr filter, integer countLimit returns nothing
call Write( whichLocation )
endfunction
hook GroupEnumUnitsInRangeOfLocCounted FixGroupEnumUnitsInRangeOfLocCountedLeaks
private function FixGroupPointOrderByIdLocLeaks takes group whichGroup, integer order, location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook GroupPointOrderByIdLoc FixGroupPointOrderByIdLocLeaks
private function FixGroupPointOrderLocLeaks takes group whichGroup, string order, location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook GroupPointOrderLoc FixGroupPointOrderLocLeaks
private function FixGroupPointOrderLocBJLeaks takes group whichGroup, string order, location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook GroupPointOrderLocBJ FixGroupPointOrderLocBJLeaks
private function FixIsLocationFoggedToPlayerLeaks takes location whichLocation, player whichPlayer returns nothing
call Write( whichLocation )
endfunction
hook IsLocationFoggedToPlayer FixIsLocationFoggedToPlayerLeaks
private function FixIsLocationInRegionLeaks takes region whichRegion, location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook IsLocationInRegion FixIsLocationInRegionLeaks
private function FixIsLocationMaskedToPlayerLeaks takes location whichLocation, player whichPlayer returns nothing
call Write( whichLocation )
endfunction
hook IsLocationMaskedToPlayer FixIsLocationMaskedToPlayerLeaks
private function FixIsLocationVisibleToPlayerLeaks takes location whichLocation, player whichPlayer returns nothing
call Write( whichLocation )
endfunction
hook IsLocationVisibleToPlayer FixIsLocationVisibleToPlayerLeaks
private function FixIsPointBlightedBJLeaks takes location where returns nothing
call Write( where )
endfunction
hook IsPointBlightedBJ FixIsPointBlightedBJLeaks
private function FixIssueBuildOrderByIdLocBJLeaks takes unit whichPeon, integer unitId, location loc returns nothing
call Write( loc )
endfunction
hook IssueBuildOrderByIdLocBJ FixIssueBuildOrderByIdLocBJLeaks
private function FixIssueHauntOrderAtLocBJLeaks takes unit whichPeon, location loc returns nothing
call Write( loc )
endfunction
hook IssueHauntOrderAtLocBJ FixIssueHauntOrderAtLocBJLeaks
private function FixIssuePointOrderByIdLocLeaks takes unit whichUnit, integer order, location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook IssuePointOrderByIdLoc FixIssuePointOrderByIdLocLeaks
private function FixIssuePointOrderLocLeaks takes unit whichUnit, string order, location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook IssuePointOrderLoc FixIssuePointOrderLocLeaks
private function FixIssuePointOrderLocBJLeaks takes unit whichUnit, string order, location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook IssuePointOrderLocBJ FixIssuePointOrderLocBJLeaks
private function FixIsTerrainPathableBJLeaks takes location where, pathingtype t returns nothing
call Write( where )
endfunction
hook IsTerrainPathableBJ FixIsTerrainPathableBJLeaks
private function FixIsUnitInRangeLocLeaks takes unit whichUnit, location whichLocation, real distance returns nothing
call Write( whichLocation )
endfunction
hook IsUnitInRangeLoc FixIsUnitInRangeLocLeaks
private function FixMeleeFindNearestMineLeaks takes location src, real range returns nothing
call Write( src )
endfunction
hook MeleeFindNearestMine FixMeleeFindNearestMineLeaks
private function FixMeleeGetLocWithinRectLeaks takes location src, rect r returns nothing
call Write( src )
endfunction
hook MeleeGetLocWithinRect FixMeleeGetLocWithinRectLeaks
private function FixMeleeGetProjectedLocLeaks takes location src, location targ, real distance, real deltaAngle returns nothing
call Write( src )
call Write( targ )
endfunction
hook MeleeGetProjectedLoc FixMeleeGetProjectedLocLeaks
private function FixMeleeRandomHeroLocLeaks takes player p, integer id1, integer id2, integer id3, integer id4, location loc returns nothing
call Write( loc )
endfunction
hook MeleeRandomHeroLoc FixMeleeRandomHeroLocLeaks
private function FixMeleeStartingUnitsForPlayerLeaks takes race whichRace, player whichPlayer, location loc, boolean doHeroes returns nothing
call Write( loc )
endfunction
hook MeleeStartingUnitsForPlayer FixMeleeStartingUnitsForPlayerLeaks
private function FixMeleeStartingUnitsHumanLeaks takes player whichPlayer, location startLoc, boolean doHeroes, boolean doCamera, boolean doPreload returns nothing
call Write( startLoc )
endfunction
hook MeleeStartingUnitsHuman FixMeleeStartingUnitsHumanLeaks
private function FixMeleeStartingUnitsNightElfLeaks takes player whichPlayer, location startLoc, boolean doHeroes, boolean doCamera, boolean doPreload returns nothing
call Write( startLoc )
endfunction
hook MeleeStartingUnitsNightElf FixMeleeStartingUnitsNightElfLeaks
private function FixMeleeStartingUnitsOrcLeaks takes player whichPlayer, location startLoc, boolean doHeroes, boolean doCamera, boolean doPreload returns nothing
call Write( startLoc )
endfunction
hook MeleeStartingUnitsOrc FixMeleeStartingUnitsOrcLeaks
private function FixMeleeStartingUnitsUndeadLeaks takes player whichPlayer, location startLoc, boolean doHeroes, boolean doCamera, boolean doPreload returns nothing
call Write( startLoc )
endfunction
hook MeleeStartingUnitsUndead FixMeleeStartingUnitsUndeadLeaks
private function FixMeleeStartingUnitsUnknownRaceLeaks takes player whichPlayer, location startLoc, boolean doHeroes, boolean doCamera, boolean doPreload returns nothing
call Write( startLoc )
endfunction
hook MeleeStartingUnitsUnknownRace FixMeleeStartingUnitsUnknownRaceLeaks
private function FixMoveLightningLocLeaks takes lightning whichBolt, location where1, location where2 returns nothing
call Write( where1 )
call Write( where2 )
endfunction
hook MoveLightningLoc FixMoveLightningLocLeaks
private function FixMoveLocationLeaks takes location whichLocation, real newX, real newY returns nothing
call Write( whichLocation )
endfunction
hook MoveLocation FixMoveLocationLeaks
private function FixMoveRectToLocLeaks takes rect whichRect, location newCenterLoc returns nothing
call Write( newCenterLoc )
endfunction
hook MoveRectToLoc FixMoveRectToLocLeaks
private function FixOffsetLocationLeaks takes location loc, real dx, real dy returns nothing
call Write( loc )
endfunction
hook OffsetLocation FixOffsetLocationLeaks
private function FixPanCameraToLocForPlayerLeaks takes player whichPlayer, location loc returns nothing
call Write( loc )
endfunction
hook PanCameraToLocForPlayer FixPanCameraToLocForPlayerLeaks
private function FixPanCameraToTimedLocForPlayerLeaks takes player whichPlayer, location loc, real duration returns nothing
call Write( loc )
endfunction
hook PanCameraToTimedLocForPlayer FixPanCameraToTimedLocForPlayerLeaks
private function FixPanCameraToTimedLocWithZForPlayerLeaks takes player whichPlayer, location loc, real zOffset, real duration returns nothing
call Write( loc )
endfunction
hook PanCameraToTimedLocWithZForPlayer FixPanCameraToTimedLocWithZForPlayerLeaks
private function FixPingMinimapLocForForceLeaks takes force whichForce, location loc, real duration returns nothing
call Write( loc )
endfunction
hook PingMinimapLocForForce FixPingMinimapLocForForceLeaks
private function FixPingMinimapLocForForceExLeaks takes force whichForce, location loc, real duration, integer style, real red, real green, real blue returns nothing
call Write( loc )
endfunction
hook PingMinimapLocForForceEx FixPingMinimapLocForForceExLeaks
private function FixPingMinimapLocForPlayerLeaks takes player whichPlayer, location loc, real duration returns nothing
call Write( loc )
endfunction
hook PingMinimapLocForPlayer FixPingMinimapLocForPlayerLeaks
private function FixPlaySoundAtPointBJLeaks takes sound soundHandle, real volumePercent, location loc, real z returns nothing
call Write( loc )
endfunction
hook PlaySoundAtPointBJ FixPlaySoundAtPointBJLeaks
private function FixPolarProjectionBJLeaks takes location source, real dist, real angle returns nothing
call Write( source )
endfunction
hook PolarProjectionBJ FixPolarProjectionBJLeaks
private function FixRectContainsLocLeaks takes rect r, location loc returns nothing
call Write( loc )
endfunction
hook RectContainsLoc FixRectContainsLocLeaks
private function FixRectFromCenterSizeBJLeaks takes location center, real width, real height returns nothing
call Write( center )
endfunction
hook RectFromCenterSizeBJ FixRectFromCenterSizeBJLeaks
private function FixRectFromLocLeaks takes location min, location max returns nothing
call Write( min )
call Write( max )
endfunction
hook RectFromLoc FixRectFromLocLeaks
private function FixRegionAddCellAtLocLeaks takes region whichRegion, location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook RegionAddCellAtLoc FixRegionAddCellAtLocLeaks
private function FixRegionClearCellAtLocLeaks takes region whichRegion, location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook RegionClearCellAtLoc FixRegionClearCellAtLocLeaks
private function FixRestoreUnitLocFacingAngleBJLeaks takes string key, string missionKey, gamecache cache, player forWhichPlayer, location loc, real facing returns nothing
call Write( loc )
endfunction
hook RestoreUnitLocFacingAngleBJ FixRestoreUnitLocFacingAngleBJLeaks
private function FixRestoreUnitLocFacingPointBJLeaks takes string key, string missionKey, gamecache cache, player forWhichPlayer, location loc, location lookAt returns nothing
call Write( loc )
call Write( lookAt )
endfunction
hook RestoreUnitLocFacingPointBJ FixRestoreUnitLocFacingPointBJLeaks
private function FixReviveHeroLocLeaks takes unit whichHero, location loc, boolean doEyecandy returns nothing
call Write( loc )
endfunction
hook ReviveHeroLoc FixReviveHeroLocLeaks
private function FixRotateCameraAroundLocBJLeaks takes real degrees, location loc, player whichPlayer, real duration returns nothing
call Write( loc )
endfunction
hook RotateCameraAroundLocBJ FixRotateCameraAroundLocBJLeaks
private function FixSetBlightLocLeaks takes player whichPlayer, location whichLocation, real radius, boolean addBlight returns nothing
call Write( whichLocation )
endfunction
hook SetBlightLoc FixSetBlightLocLeaks
private function FixSetBlightRadiusLocBJLeaks takes boolean addBlight, player whichPlayer, location loc, real radius returns nothing
call Write( loc )
endfunction
hook SetBlightRadiusLocBJ FixSetBlightRadiusLocBJLeaks
private function FixSetCameraPositionLocForPlayerLeaks takes player whichPlayer, location loc returns nothing
call Write( loc )
endfunction
hook SetCameraPositionLocForPlayer FixSetCameraPositionLocForPlayerLeaks
private function FixSetCameraQuickPositionLocLeaks takes location loc returns nothing
call Write( loc )
endfunction
hook SetCameraQuickPositionLoc FixSetCameraQuickPositionLocLeaks
private function FixSetCameraQuickPositionLocForPlayerLeaks takes player whichPlayer, location loc returns nothing
call Write( loc )
endfunction
hook SetCameraQuickPositionLocForPlayer FixSetCameraQuickPositionLocForPlayerLeaks
private function FixSetDoodadAnimationBJLeaks takes string animName, integer doodadID, real radius, location center returns nothing
call Write( center )
endfunction
hook SetDoodadAnimationBJ FixSetDoodadAnimationBJLeaks
private function FixSetFogStateRadiusLocLeaks takes player forWhichPlayer, fogstate whichState, location center, real radius, boolean useSharedVision returns nothing
call Write( center )
endfunction
hook SetFogStateRadiusLoc FixSetFogStateRadiusLocLeaks
private function FixSetImagePositionBJLeaks takes image whichImage, location where, real zOffset returns nothing
call Write( where )
endfunction
hook SetImagePositionBJ FixSetImagePositionBJLeaks
private function FixSetItemPositionLocLeaks takes item whichItem, location loc returns nothing
call Write( loc )
endfunction
hook SetItemPositionLoc FixSetItemPositionLocLeaks
private function FixSetRectFromLocLeaks takes rect whichRect, location min, location max returns nothing
call Write( min )
call Write( max )
endfunction
hook SetRectFromLoc FixSetRectFromLocLeaks
private function FixSetSoundPositionLocBJLeaks takes sound soundHandle, location loc, real z returns nothing
call Write( loc )
endfunction
hook SetSoundPositionLocBJ FixSetSoundPositionLocBJLeaks
private function FixSetTerrainPathableBJLeaks takes location where, pathingtype t, boolean flag returns nothing
call Write( where )
endfunction
hook SetTerrainPathableBJ FixSetTerrainPathableBJLeaks
private function FixSetTerrainTypeBJLeaks takes location where, integer terrainType, integer variation, integer area, integer shape returns nothing
call Write( where )
endfunction
hook SetTerrainTypeBJ FixSetTerrainTypeBJLeaks
private function FixSetTextTagPosBJLeaks takes texttag tt, location loc, real zOffset returns nothing
call Write( loc )
endfunction
hook SetTextTagPosBJ FixSetTextTagPosBJLeaks
private function FixSetUnitFacingToFaceLocTimedLeaks takes unit whichUnit, location target, real duration returns nothing
call Write( target )
endfunction
hook SetUnitFacingToFaceLocTimed FixSetUnitFacingToFaceLocTimedLeaks
private function FixSetUnitPositionLocLeaks takes unit whichUnit, location whichLocation returns nothing
call Write( whichLocation )
endfunction
hook SetUnitPositionLoc FixSetUnitPositionLocLeaks
private function FixSetUnitPositionLocFacingBJLeaks takes unit whichUnit, location loc, real facing returns nothing
call Write( loc )
endfunction
hook SetUnitPositionLocFacingBJ FixSetUnitPositionLocFacingBJLeaks
private function FixSetUnitPositionLocFacingLocBJLeaks takes unit whichUnit, location loc, location lookAt returns nothing
call Write( loc )
call Write( lookAt )
endfunction
hook SetUnitPositionLocFacingLocBJ FixSetUnitPositionLocFacingLocBJLeaks
private function FixSetUnitRallyPointLeaks takes unit whichUnit, location targPos returns nothing
call Write( targPos )
endfunction
hook SetUnitRallyPoint FixSetUnitRallyPointLeaks
private function FixSmartCameraPanBJLeaks takes player whichPlayer, location loc, real duration returns nothing
call Write( loc )
endfunction
hook SmartCameraPanBJ FixSmartCameraPanBJLeaks
private function FixTerrainDeformationCraterBJLeaks takes real duration, boolean permanent, location where, real radius, real depth returns nothing
call Write( where )
endfunction
hook TerrainDeformationCraterBJ FixTerrainDeformationCraterBJLeaks
private function FixTerrainDeformationRandomBJLeaks takes real duration, location where, real radius, real minDelta, real maxDelta, real updateInterval returns nothing
call Write( where )
endfunction
hook TerrainDeformationRandomBJ FixTerrainDeformationRandomBJLeaks
private function FixTerrainDeformationRippleBJLeaks takes real duration, boolean limitNeg, location where, real startRadius, real endRadius, real depth, real wavePeriod, real waveWidth returns nothing
call Write( where )
endfunction
hook TerrainDeformationRippleBJ FixTerrainDeformationRippleBJLeaks
private function FixTerrainDeformationWaveBJLeaks takes real duration, location source, location target, real radius, real depth, real trailDelay returns nothing
call Write( source )
call Write( target )
endfunction
hook TerrainDeformationWaveBJ FixTerrainDeformationWaveBJLeaks
private function FixTransmissionFromUnitTypeWithNameBJLeaks takes force toForce, player fromPlayer, integer unitId, string unitName, location loc, sound soundHandle, string message, integer timeType, real timeVal, boolean wait returns nothing
call Write( loc )
endfunction
hook TransmissionFromUnitTypeWithNameBJ FixTransmissionFromUnitTypeWithNameBJLeaks
private function FixUnitDamagePointLocLeaks takes unit whichUnit, real delay, real radius, location loc, real amount, attacktype whichAttack, damagetype whichDamage returns nothing
call Write( loc )
endfunction
hook UnitDamagePointLoc FixUnitDamagePointLocLeaks
private function FixUnitDropItemPointLocLeaks takes unit whichUnit, item whichItem, location loc returns nothing
call Write( loc )
endfunction
hook UnitDropItemPointLoc FixUnitDropItemPointLocLeaks
private function FixUnitUseItemPointLocLeaks takes unit whichUnit, item whichItem, location loc returns nothing
call Write( loc )
endfunction
hook UnitUseItemPointLoc FixUnitUseItemPointLocLeaks
private function FixWaygateSetDestinationLocBJLeaks takes unit waygate, location loc returns nothing
call Write( loc )
endfunction
hook WaygateSetDestinationLocBJ FixWaygateSetDestinationLocBJLeaks
endscope
//-------------------- group --------------------
scope GroupLeakFix
//! runtextmacro LeakFix_Cleaner( "group", "DestroyGroup" )
// Please enter functions that create the type here.
private function FixCountUnitsInGroupLeaks takes group g returns nothing
call Write( g )
endfunction
hook CountUnitsInGroup FixCountUnitsInGroupLeaks
private function FixFirstOfGroupLeaks takes group whichGroup returns nothing
call Write( whichGroup )
endfunction
hook FirstOfGroup FixFirstOfGroupLeaks
private function FixForGroupLeaks takes group whichGroup, code callback returns nothing
call Write( whichGroup )
endfunction
hook ForGroup FixForGroupLeaks
private function FixForGroupBJLeaks takes group whichGroup, code callback returns nothing
call Write( whichGroup )
endfunction
hook ForGroupBJ FixForGroupBJLeaks
private function FixGetRandomSubGroupLeaks takes integer count, group sourceGroup returns nothing
call Write( sourceGroup )
endfunction
hook GetRandomSubGroup FixGetRandomSubGroupLeaks
private function FixGroupAddGroupLeaks takes group sourceGroup, group destGroup returns nothing
call Write( sourceGroup )
call Write( destGroup )
endfunction
hook GroupAddGroup FixGroupAddGroupLeaks
private function FixGroupAddUnitLeaks takes group whichGroup, unit whichUnit returns nothing
call Write( whichGroup )
endfunction
hook GroupAddUnit FixGroupAddUnitLeaks
private function FixGroupAddUnitSimpleLeaks takes unit whichUnit, group whichGroup returns nothing
call Write( whichGroup )
endfunction
hook GroupAddUnitSimple FixGroupAddUnitSimpleLeaks
private function FixGroupClearLeaks takes group whichGroup returns nothing
call Write( whichGroup )
endfunction
hook GroupClear FixGroupClearLeaks
private function FixGroupEnumUnitsInRangeLeaks takes group whichGroup, real x, real y, real radius, boolexpr filter returns nothing
call Write( whichGroup )
endfunction
hook GroupEnumUnitsInRange FixGroupEnumUnitsInRangeLeaks
private function FixGroupEnumUnitsInRangeCountedLeaks takes group whichGroup, real x, real y, real radius, boolexpr filter, integer countLimit returns nothing
call Write( whichGroup )
endfunction
hook GroupEnumUnitsInRangeCounted FixGroupEnumUnitsInRangeCountedLeaks
private function FixGroupEnumUnitsInRangeOfLocLeaks takes group whichGroup, location whichLocation, real radius, boolexpr filter returns nothing
call Write( whichGroup )
endfunction
hook GroupEnumUnitsInRangeOfLoc FixGroupEnumUnitsInRangeOfLocLeaks
private function FixGroupEnumUnitsInRangeOfLocCountedLeaks takes group whichGroup, location whichLocation, real radius, boolexpr filter, integer countLimit returns nothing
call Write( whichGroup )
endfunction
hook GroupEnumUnitsInRangeOfLocCounted FixGroupEnumUnitsInRangeOfLocCountedLeaks
private function FixGroupEnumUnitsInRectLeaks takes group whichGroup, rect r, boolexpr filter returns nothing
call Write( whichGroup )
endfunction
hook GroupEnumUnitsInRect FixGroupEnumUnitsInRectLeaks
private function FixGroupEnumUnitsInRectCountedLeaks takes group whichGroup, rect r, boolexpr filter, integer countLimit returns nothing
call Write( whichGroup )
endfunction
hook GroupEnumUnitsInRectCounted FixGroupEnumUnitsInRectCountedLeaks
private function FixGroupEnumUnitsOfPlayerLeaks takes group whichGroup, player whichPlayer, boolexpr filter returns nothing
call Write( whichGroup )
endfunction
hook GroupEnumUnitsOfPlayer FixGroupEnumUnitsOfPlayerLeaks
private function FixGroupEnumUnitsOfTypeLeaks takes group whichGroup, string unitname, boolexpr filter returns nothing
call Write( whichGroup )
endfunction
hook GroupEnumUnitsOfType FixGroupEnumUnitsOfTypeLeaks
private function FixGroupEnumUnitsOfTypeCountedLeaks takes group whichGroup, string unitname, boolexpr filter, integer countLimit returns nothing
call Write( whichGroup )
endfunction
hook GroupEnumUnitsOfTypeCounted FixGroupEnumUnitsOfTypeCountedLeaks
private function FixGroupEnumUnitsSelectedLeaks takes group whichGroup, player whichPlayer, boolexpr filter returns nothing
call Write( whichGroup )
endfunction
hook GroupEnumUnitsSelected FixGroupEnumUnitsSelectedLeaks
private function FixGroupImmediateOrderLeaks takes group whichGroup, string order returns nothing
call Write( whichGroup )
endfunction
hook GroupImmediateOrder FixGroupImmediateOrderLeaks
private function FixGroupImmediateOrderBJLeaks takes group whichGroup, string order returns nothing
call Write( whichGroup )
endfunction
hook GroupImmediateOrderBJ FixGroupImmediateOrderBJLeaks
private function FixGroupImmediateOrderByIdLeaks takes group whichGroup, integer order returns nothing
call Write( whichGroup )
endfunction
hook GroupImmediateOrderById FixGroupImmediateOrderByIdLeaks
private function FixGroupPickRandomUnitLeaks takes group whichGroup returns nothing
call Write( whichGroup )
endfunction
hook GroupPickRandomUnit FixGroupPickRandomUnitLeaks
private function FixGroupPointOrderLeaks takes group whichGroup, string order, real x, real y returns nothing
call Write( whichGroup )
endfunction
hook GroupPointOrder FixGroupPointOrderLeaks
private function FixGroupPointOrderByIdLeaks takes group whichGroup, integer order, real x, real y returns nothing
call Write( whichGroup )
endfunction
hook GroupPointOrderById FixGroupPointOrderByIdLeaks
private function FixGroupPointOrderByIdLocLeaks takes group whichGroup, integer order, location whichLocation returns nothing
call Write( whichGroup )
endfunction
hook GroupPointOrderByIdLoc FixGroupPointOrderByIdLocLeaks
private function FixGroupPointOrderLocLeaks takes group whichGroup, string order, location whichLocation returns nothing
call Write( whichGroup )
endfunction
hook GroupPointOrderLoc FixGroupPointOrderLocLeaks
private function FixGroupPointOrderLocBJLeaks takes group whichGroup, string order, location whichLocation returns nothing
call Write( whichGroup )
endfunction
hook GroupPointOrderLocBJ FixGroupPointOrderLocBJLeaks
private function FixGroupRemoveGroupLeaks takes group sourceGroup, group destGroup returns nothing
call Write( sourceGroup )
call Write( destGroup )
endfunction
hook GroupRemoveGroup FixGroupRemoveGroupLeaks
private function FixGroupRemoveUnitLeaks takes group whichGroup, unit whichUnit returns nothing
call Write( whichGroup )
endfunction
hook GroupRemoveUnit FixGroupRemoveUnitLeaks
private function FixGroupRemoveUnitSimpleLeaks takes unit whichUnit, group whichGroup returns nothing
call Write( whichGroup )
endfunction
hook GroupRemoveUnitSimple FixGroupRemoveUnitSimpleLeaks
private function FixGroupTargetDestructableOrderLeaks takes group whichGroup, string order, widget targetWidget returns nothing
call Write( whichGroup )
endfunction
hook GroupTargetDestructableOrder FixGroupTargetDestructableOrderLeaks
private function FixGroupTargetItemOrderLeaks takes group whichGroup, string order, widget targetWidget returns nothing
call Write( whichGroup )
endfunction
hook GroupTargetItemOrder FixGroupTargetItemOrderLeaks
private function FixGroupTargetOrderLeaks takes group whichGroup, string order, widget targetWidget returns nothing
call Write( whichGroup )
endfunction
hook GroupTargetOrder FixGroupTargetOrderLeaks
private function FixGroupTargetOrderBJLeaks takes group whichGroup, string order, widget targetWidget returns nothing
call Write( whichGroup )
endfunction
hook GroupTargetOrderBJ FixGroupTargetOrderBJLeaks
private function FixGroupTargetOrderByIdLeaks takes group whichGroup, integer order, widget targetWidget returns nothing
call Write( whichGroup )
endfunction
hook GroupTargetOrderById FixGroupTargetOrderByIdLeaks
private function FixGroupTrainOrderByIdBJLeaks takes group g, integer unitId returns nothing
call Write( g )
endfunction
hook GroupTrainOrderByIdBJ FixGroupTrainOrderByIdBJLeaks
private function FixIsUnitGroupDeadBJLeaks takes group g returns nothing
call Write( g )
endfunction
hook IsUnitGroupDeadBJ FixIsUnitGroupDeadBJLeaks
private function FixIsUnitGroupEmptyBJLeaks takes group g returns nothing
call Write( g )
endfunction
hook IsUnitGroupEmptyBJ FixIsUnitGroupEmptyBJLeaks
private function FixIsUnitGroupInRectBJLeaks takes group g, rect r returns nothing
call Write( g )
endfunction
hook IsUnitGroupInRectBJ FixIsUnitGroupInRectBJLeaks
private function FixIsUnitInGroupLeaks takes unit whichUnit, group whichGroup returns nothing
call Write( whichGroup )
endfunction
hook IsUnitInGroup FixIsUnitInGroupLeaks
private function FixSelectGroupBJLeaks takes group g returns nothing
call Write( g )
endfunction
hook SelectGroupBJ FixSelectGroupBJLeaks
private function FixSelectGroupForPlayerBJLeaks takes group g, player whichPlayer returns nothing
call Write( g )
endfunction
hook SelectGroupForPlayerBJ FixSelectGroupForPlayerBJLeaks
endscope
endlibrary
Special Thanks
Vexorian... hook is awesome.
The SciTe developers & the ruby interpreter
The internet
Q&A
Q: Does this work with EGUI?
A: Well... Not all leaks might be removed...
Q: Cannot I just use EGUI?
A: EGUI does not automatically remove memory leaks.
Q: Does this make GUIers lazy?
A: No. It just makes them productive and more creative.
Q: Is this slow?
A: Well... It's slower than removing stuff manuable, but faster than not removing it at all.
Q: Does this leak?
A: You get leaks if you just create Locations without using them.
Q: How do I install this?
A: Press Alt-F4. That will automatically install all files needed. Alternatively, read the thread.
Attachments
Last edited: