| 10-06-2006, 07:43 PM | #1 |
What happens when I do something like this: JASS:function x takes nothing returns nothing local conditionfunc c=Condition function whatever) local trigger t=CreateTrigger() local triggercondition tc=TriggerAddCondition(t,c) //some triggerevents call DestroyCondition(c) set t=null set tc=null set c=null endfunction Plx reply if you have a clue or allready (mass) tested. Thx. |
| 10-06-2006, 09:39 PM | #2 |
You cannot destroy a condition/boolexpr if you need to use it in future. So the answer is no. |
| 10-06-2006, 10:21 PM | #3 |
!!! There is JASS:TriggerRemoveCondition |
| 10-07-2006, 12:52 PM | #4 |
@UnMi:TriggerRemoveAction is to remove conditionfunc from the trigger, not destroy the conditionfunc, which is DestroyCondition(whhichconditionfunc)'s job. @blu_da_noob: I guess you missunderstood the question, so I repharse it: Whil the trigger stil do the check even if the conditionfunc itself does not exist as handle id anymore? |
| 10-07-2006, 01:14 PM | #5 | |
Quote:
TriggerRemoveCondition ;) |
| 10-07-2006, 01:29 PM | #6 |
Hmm, so this means that if you are destroying a dynamic trigger with a condition, you would not have to "TriggerRemoveCondition" from it to prevent leaks? |
| 10-07-2006, 02:54 PM | #7 | |
Quote:
I did answer that question in my first post, but if you want a more explicitly stated answer: destroying a boolexpr/condition will mean it can no longer be used (I haven't checked if it causes it to evaluate to always true or false, but it will not check the actual condition). |
| 10-07-2006, 05:02 PM | #8 |
Thx. +rep to blu_da_noob Edit: can not rep you again xD @UnMi: you must remove the condition and then destroy the condition func, if it is not used otherwise. |
