slouken at devolution.com
Sun Jan 19 16:14:01 PST 2003
-----BEGIN PGP SIGNED MESSAGE-----
On Monday 06 January 2003 16:50, Roger D. Vargas wrote:
> On Sat, 4 Jan 2003, Matt Borkowski wrote:
> > In the loadimg() function you do
> > tmp=SDL_LoadBMP("sail.bmp");
> > without first freeing tmp from when you loaded
> > "backg.bmp".
> Does it matters? The example runs without segfaults.
Yes, it does matter. If you don't free a surface, you'll get a memory leak,
i.e. the memory used up by the earlier bitmap "backg.bmp" will remain
allocated. It will only be reclaimed by the OS once your program ends.
Memory leaks are obviously bad because you might run out of memory simply
because to many no-longer-used but still allocated blocks of memory are
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
-----END PGP SIGNATURE-----
More information about the SDL