One memory leak problem

  • Thread starter Thread starter Lordbevan
  • Start date Start date
L

Lordbevan

Guest
Code:
Unit - Create 3 Soldier for Player 1 (Red) at (Center of Spawn <gen>) facing Default building facing (270.0) degrees

Does this cause a leak? Its spawn at a region not a point. But accoring to one post i read, it is also a leak?
 
LOL Then you guys should say create a unit is automatically going to cause a leak, instead of using a jargon thing such as a point.
 
it wouldn't be right to say that because we want to be as specific as possible in the information we tell you, so saying "creating a unit leaks" is far too generic to be of any use to anyone.

As I used to say, you shouldn't be obsessive about leaks, just assign things like that into temp global variables - that way you don't need to care about the issue at all. I don't think a few people liked this advice the last time I gave it, so don't use it if it doesn't suit your taste.
 
Lordbevan said:
LOL Then you guys should say create a unit is automatically going to cause a leak, instead of using a jargon thing such as a point.
But that's not true.

This part:
Code:
(Center of Spawn <gen>)
causes the leak. Whenever you have a Center Of Region or nearly any other function that returns a point you will have a leak... except if you set a global variable to that and never change the variable. That won't leak, simply because the function is only called once.
 
Okay so if i have 1 spawn trigger that runs everytime, I do this:

Set Tempoint1=centre of spawn<gen>
then make the spawn at tempoint1 and there wont be a leak right?
 
I suggest you do a "call RemoveLocation(udg_temppoint1)" afterwards to further prevent leaks.
 
but why is that necessary if he puts it into a global variable? there is a handle attached to the point so the point is not going anywhere and so won't leak.

btw does RemoveLocation destroy the variable itself or does it remove the reference to the point made by the variable? because if its the former, thats not a very good idea.
 
Darg said:
but why is that necessary if he puts it into a global variable? there is a handle attached to the point so the point is not going anywhere and so won't leak.
Depends.
If you overwrite the vaule of the variable the point is lost and is leaking.
So if you dont have a problem with having tons of globals, initilize them at the beginig and never change them you dont need to remove them. If you want to change the variable sometime in the game you have to remove the previus vaule.


Darg said:
btw does RemoveLocation destroy the variable itself or does it remove the reference to the point made by the variable? because if its the former, thats not a very good idea.
It removes the point, not the reference not the variable. So the variable will still pointing to the place in the memory where the point was, but the point doesnt exist. (This is why you have to null local variables so the reference dissaperes)
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    we were down for a minute - think a log file or something got too big
    +1
  • Ghan Ghan:
    The alerts say it was down for a while unfortunately.
  • Ghan Ghan:
    Didn't know what was going on while I was at work.
  • Ghan Ghan:
    Disk filled up with logs. Fixed now.
    +1
  • The Helper The Helper:
    not a problem at all thanks for getting us back up
  • The Helper The Helper:
    I think the bots are finding a way to get through the anubis
  • The Helper The Helper:
    Happy Wednesday Everyone! Hope everyone has a Fantastic Day!
    +1
  • The Helper The Helper:
    Yeah, stats are showing big bot influx like 12k page views.
  • Wizard Wizard:
    :wave:
    +1
  • Ghan Ghan:
    TH changed his avatar again. 6 more weeks of summer.
    +3
  • Wizard Wizard:
    lol
    +1
  • The Helper The Helper:
    Guys just a heads up I am going to be shutting the site down soon. I am just waiting on the NUON people to decide whether they want to transfer forum data and keep the discord. My email is [email protected] for anyone that wants to keep in touch and I have a facebook too. I will make an official post later. Love you guys and will miss everyone!
    +1
  • V-SNES V-SNES:
    Sent a pm @The Helper
  • Stephen Stephen:
    Oh no - please don't lose the Nuon content
    +1
  • The Helper The Helper:
    Someone email AtariAge and see if they want me to transfer the forum data over to it
  • Ghan Ghan:
    Could probably keep NUON stuff around here if we wanted.
  • Ghan Ghan:
    Hmm what to do about the World Editor site though?
  • Stephen Stephen:
    I'd rather personally just own a backup of the Nuon data than see it go to AtariAge honestly. If it gets enshittified as per usual, or if some of the "regular" Jaguar folks get there, it's not gonna be fun
  • The Helper The Helper:
    There will be a github of the forum data so the NUON Forum Data I guess would be available there
  • The Helper The Helper:
    World Editor is technically Ryoko stuff not mine you guys can keep that I am not in that even
  • jonas jonas:
    :( end of an era :(
  • The Helper The Helper:
    Dont think of it as an end jonas - think of it as a beginning, because really my friend that is what it is.
  • A Andyoyo:
    Thank you for the hard work over the years. It did not go unnoticed.

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top