[SDL] ot - memory leaks
Stefan Hendriks
stefanhen83 at gmail.com
Fri Aug 3 02:17:05 PDT 2007
Java has a garbage collector, which takes a lot of stuff of your
hands (though not everything, there are some quirks).
In C/C++, everything you allocate, must be de-allocated. ;-)
Ofcourse, there are exceptions..
2007/8/3, Jacek Poplawski <jacekpoplawski at gmail.com>:
> On 8/3/07, neil at cloudsprinter.com <neil at cloudsprinter.com> wrote:
>
> > but if it's inside a function i can only access it from that function, my
> > (probably worng) understanding was that anything created in a function was
> > killed at the end of that fucntion, or is that java?
>
> If you allocate memory inside function you should free it inside or outside
> that function.
> That's why using pointers in dangerous.
> I think you should play with C/C++ first. You can find lots of good books
> about it.
>
> --
> Free Software - find interesting programs and change them
> NetHack - meet interesting creatures, kill them and eat their bodies
> Usenet - meet interesting people from all over the world and flame them
> Decopter - unrealistic helicopter simulator, get it from
> http://decopter.sf.net
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
>
--
Stefan Hendriks
-----------------------
http://www.fundynamic.nl
More information about the SDL
mailing list