SDL_ConvertSurface memory question

Hi there,

When using SDL_ConvertSurface, must I free my old surface ?

If I do not, I’ve memory problems because I create and convert lot’s of
surfaces

I looked at the source code (SDL 1.2)

I’m not sure because it’s written:

/* Clean up the original surface, and update converted surface */

But there is no SDL_FreeSurface(surface)

Is It OK?

thanks–
Xavier

Hi there,

When using SDL_ConvertSurface, must I free my old surface ?

Well, “must” isn’t really the word - you don’t have to, if you still
need the old surface. :wink:

If I do not, I’ve memory problems because I create and convert lot’s of
surfaces

I looked at the source code (SDL 1.2)

I’m not sure because it’s written:

/* Clean up the original surface, and update converted surface */

But there is no SDL_FreeSurface(surface)

Is It OK?

Yep. RTFM - it speaks of copying; not replacing, and says nothing about
deleting anything. :slight_smile:

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |--------------------------------------> david at linuxdj.com -'On Wednesday 19 September 2001 18:05, Xavier Servettaz wrote: