POV-Ray : Newsgroups : povray.off-topic : c++ memory question : Re: c++ memory question Server Time
11 Oct 2024 11:10:13 EDT (-0400)
  Re: c++ memory question  
From: Vincent Le Chevalier
Date: 2 Oct 2007 18:52:52
Message: <4702cbc4$1@news.povray.org>

> Fredrik Eriksson wrote:
>>
>> No. Indeed, you must not, as it is not dynamically allocated.
>>
>>> Is the memory used by that array freed after the program is terminated?
>>
>> It is freed when 'i' goes out of scope. If 'i' is in namespace scope, 
>> it goes out of scope when the program ends.
> 
> Thank you. My program should not have any memory leaks, then. I assume 
> this also applies to other variables as well?
> 

Everything that wasn't new-ed.

Normally the OS frees the memory used when the program ends anyway... So 
I don't understand exactly what you observe in your game. You mean it 
takes more memory when it runs for the 6th time than it took the first time?

-- 
Vincent


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.