| 06-06-2004, 02:05 AM | #16 |
Er..Temp units? You lost me. I dont think anyone mentioned temp units. |
| 06-06-2004, 02:22 AM | #17 |
in the tut it says that another type of leak could be temporary units and special effects.. what are temporary units? |
| 06-06-2004, 04:26 AM | #18 |
Hmmm I'm not sure. All I can tell you is that removing a unit from the game almost completely removes its memory usage. Maybe by temporary units, cubasis means units you use as dummys in spells. IE make a unit cast a storm bolt, make sure you remove it after it's been used. BTW thanks for giving rep; I'm glad some people do. |
| 06-07-2004, 07:22 PM | #19 |
One thing that I've noticed helps maps that don't use any resurrecting abilities is to run this trigger: Code:
Remove Dead
Events
Unit - A unit Dies
Conditions
Actions
Unit - Remove (Triggering unit) from the game |
| 06-10-2004, 11:41 AM | #20 |
Yes, That is what I ment with temp units, but then I remembered that they would get cleaned up by a trigger similarly to what Fyre posted, and my original concern was for the jass user, as he should dereference "temporary" units just as he does with locations, which is ofcourse outside the scope of this tutorial. I do though reccomend to have like a ... 8-9 second delay before the Remove part of the death-trigger, so the body fully/semi degenerates visually. ~Cubasis |
| 06-19-2004, 01:10 AM | #21 |
Hello there ;) I'm new to this "getting-rid-of-memory-leaks-thing" and I've got a problem. I want to destroy my variables I made, to clean up some memory, in-game, which I don't use anymore. But everytime I try (with Custom Script call DestroyVariable / DestroyQuestItem), the Editor says, that he expects a function. So could anybody give me a reference to all functions in WCIII available or at least the function I require, please? call QuestItemSetCompletedBJ( udg_BarrenPlantsRequired, true ) That's the line, were he sets the QuestItem to Complete, so I tried to extrapolate the function, but, as it seems, my guess was totally wrong :( |
| 06-19-2004, 01:53 AM | #22 |
lol.. i love how u refer to the editor as "he". and i dont think quest items would cause leakage. and plus, quest arent common so... u dont need to worry bout it. |
| 06-19-2004, 12:23 PM | #23 |
Well, I've got a very intimate relationship with my Editor :D:D:D:D:D and thanks for the reply, but, does your post mean that, if I'm going to make a singleplayer campaign, that I don't need to pay too much attention to memory leaks? |
| 06-19-2004, 01:12 PM | #24 |
His post means that a QuestItem won't create a serious memory leak because it's not used very often. |
| 06-19-2004, 03:48 PM | #25 |
Well...there are 50 Barren Plants, but okay, if you say so ^_^ |
| 06-19-2004, 04:34 PM | #26 |
If you set a unit to null in hopes of getting memory back you are infact doing nothing. Using a toaster to keep your meat cold does not work and neither does this. |
| 06-19-2004, 05:15 PM | #27 |
unit to null? I wanted to destroy some variables, which I'll never use afterwards ;) |
| 06-19-2004, 06:14 PM | #28 |
With local variables too? I saw lots of people doing it, namely alphadisjunction, so I started to do it. I thought that local variables worked a bit differently from globals... |
| 06-20-2004, 03:30 PM | #29 |
Quest Items get destroyed when you destroy the Quest (not really proven, but likely). Here are a couple of destroy-function-names: RemoveLocation // Points RemoveRect // WE "regions", the thing you place in WE. RemoveRegion //Don't confuse this with rect, this is not what you work with in WE. RemoveWeatherEffect DestroyBoolExpr // Condition or Filter DestroyEffect //Special Effect DestroyFogModifier //Visibility Modifyer DestroyForce //Player Group DestroyGroup //Unit Group DestroyLeaderboard DestroyMultiboard DestroyQuest DestroyTextTag //Floating Text DestroyTimer DestroyTimerDialog DestroyTrigger And if you "are" working with JASS and/or local variables... You come to a new kind of memory leak. Basicly, what you want to do, is ... whenever you create a local handle variable (Handle = Anything except: Integer, Real, String, Boolean), you will want to set it too null at the end of the function. This is only important for stuff that you create temporarely, like locations and groups, but can also apply to units. But you should not worry about setting your Hero local variable to null, as it will exist the complete game, and generally you don't really need to set unit variables to null. But there is nothing wrong with it. ~Cubasis |
| 06-28-2004, 04:27 AM | #30 | |
Quote:
Does that apply to the similar GUI function too? So based on that, "Position of triggering unit" and "Target point of ability being cast" leaks too? Is there anyway to fix those leaks? |
