Clan SliD Index du Forum
Clan SliD Index du ForumFAQRechercherS’enregistrerConnexion

How to Remove a Memory Leak ?

 
Poster un nouveau sujet   Répondre au sujet    Clan SliD Index du Forum -> Worldedit -> Tutorials
Sujet précédent :: Sujet suivant  
Auteur Message
Vladadamm
Flooder n°1
Flooder n°1

Hors ligne

Inscrit le: 23 Juil 2011
Messages: 1 587
Localisation: Toulouse
Masculin
Point(s): 110
Niveau de slide:

MessagePosté le: 30/12/2011, 22:56    Sujet du message: How to Remove a Memory Leak ? Répondre en citant

Dynamic Unit Groups :

Two ways :

set bj_wantDestroyGroup = true
Pick every units in ...


or

Set GroupVar = Units in ...
Pick every units in GroupVar and do Actions/ACTIONS
call DestroyGroup(udg_GroupVar)


Note : "Pick all units of Type UNIT-TYPE" always leaks.

Dynamic Locations :

Only one way :

Set PointVar = Somewhere
Move UNIT to PointVar
call RemoveLocation(udg_PointVar)


Note : The action "Camera - Pan camera as needed" always leak.

Dynamic Forces/Player Group :

One way :

Set ForceVar = ...
Pick every Player in ForceVar and do Actions
call DestroyForce(udg_ForceVar)


Note : (All Players) never leak and Destroying it will cause problems.

Special Effects :

One way :

Create a Special Effect at ATTACHMENT of UNIT using MODEL
Destroy (Last created special effect)


Note : Special effects' leaks are the only which can be deleted correctly after a wait. For this, you just need to do this :
Create a Special Effect at ATTACHMENT of UNIT using MODEL
Set EffectVar = (Last created special effect)
Wait 10.00 seconds
Destroy EffectVar


Dynamic Regions :

One way :

Set RegionVar = (PointVar) with size 500,500
Unit - Cause UNIT to damage (RegionVar dealing 500 damage using attack type Normal and damage type Normal
Custom Script: call RemoveRect(udg_RegionVar)


Note : This one is nearly unknown, since the region creation like this is very rare.

Strings :

As far as i know it's impossible to remove the leak from a String.

Note : Strings are strange and minor leaks, as they are reused. If you use "SliD" as a String it will leak once, but if you reuse "SliD" as string, it won't create another leak because he uses the same data than the first "SliD".

Array Handles :

Two way, 1 general and 1 more specific :

Set ArrayHandleVar = What you want
ACTIONS
set ArrayHandleVar = null


The specific way is too big for be quoted there, it's nearly all the functions which start with Destroy or Remove. For example, RemoveUnit, DestroyItem, etc... But i already quoted the most important ones ^^. But note that for some variables types, Unit for example, it will remove the unit from the game and remove the leak by the same way but if you use the first way, it will only remove the leak.

It's to you to decide which one you'll take in each case.

Also, this won't totally remove the leak for Units.
There is no way to remove this little part of the leak. It's minor, but it's still here.
The only way to "counter" this is unit recycling. It don't remove it but it lowers it.

Hashtables :

Here you have 2choice : Clear the Hashtable (Parent) or clear only the datas stocked in an Handle in the Hashtable (Child).

Parent :

Two ways :

JASS : call FlushParentHashtable(udg_HashtableVar)

or

GUI : Clear HashtableVar

Child :

Two ways :

JASS : call FlushChildHashtable(udg_HashtableVar, udg_HandleVar)

or

GUI : Clear all child hashtables of child HandleVar in HashtableVar

Floating Text :

For this, it's same than for the Special Effects, you just need to Destroy it.

GUI : Destroy FloatingTextVar.

Another way :

Change FloatingTextVar : Disable permanence
Change the lifespan of FloatinTextVar to 5.00 seconds


Items :

The items with the line "Use automaticly when acquired" are not totally removed when used.
Their models will stay (but wwith a little size) where you used it, and their handle won't be recycled (so handle leak).

You can find on the net functions/librairies to remove that leak.
_________________


Dernière édition par Vladadamm le 16/09/2012, 11:11; édité 2 fois
Revenir en haut
Skype
Publicité






MessagePosté le: 30/12/2011, 22:56    Sujet du message: Publicité

PublicitéSupprimer les publicités ?
Revenir en haut
Vladadamm
Flooder n°1
Flooder n°1

Hors ligne

Inscrit le: 23 Juil 2011
Messages: 1 587
Localisation: Toulouse
Masculin
Point(s): 110
Niveau de slide:

MessagePosté le: 31/12/2011, 16:42    Sujet du message: How to Remove a Memory Leak ? Répondre en citant

Hashtables and FLoating Text added.
_________________


Revenir en haut
Skype
Contenu Sponsorisé






MessagePosté le: Aujourd’hui à 22:58    Sujet du message: How to Remove a Memory Leak ?

Revenir en haut
Montrer les messages depuis:   
Poster un nouveau sujet   Répondre au sujet    Clan SliD Index du Forum -> Worldedit -> Tutorials Toutes les heures sont au format GMT + 2 Heures
Page 1 sur 1

 
Sauter vers:  

Portail | Index | créer son forum | Forum gratuit d’entraide | Annuaire des forums gratuits | Signaler une violation | Conditions générales d'utilisation
darkages Template © larme d'ange
Powered by phpBB © 2001, 2005 phpBB Group
Traduction par : phpBB-fr.com