[SDL] Memory Leak

Manuel Lopez Blasi vladisblood at yahoo.com.ar
Thu Sep 13 20:46:43 PDT 2007


Ken Rogoway <Ken <at> HomebrewSoftware.com> writes:

> 
> 
> -----Original Message-----
> From: sdl-bounces <at> lists.libsdl.org [mailto:sdl-bounces <at>
lists.libsdl.org] On
> Behalf Of Manuel Lopez Blasi
> Sent: Thursday, September 13, 2007 10:28 PM
> To: sdl <at> libsdl.org
> Subject: [SDL] Memory Leak
> 
> Hi,
> i'm making my little program, kinda remake of robocop arcade bonus stage.
> I noticed a memory leak when i call my function "calcular_render", grabbing
> 200 kb /second. I dunno what might be the cause. Any ideas? Thanks in
> advance, here's the complete code (I'm working in DevCpp):
> 
> --------------------------------------------------------------------
> I would gladly help but I do not see the definition for the "cuadro_princi"
> class that you use throughout your example. 


Hi Ken, here's the definition:

cuadro_princi is of Cframe class wich is:


Cframe cuadro_princi;

class Cframe
{
public:
SDL_Surface *screen;      
FILE *archlog;
Uint32 time_refbase;
Uint32 time_actual;

SDL_TimerID rendertimer;

int intervalo_render;
bool clsok;
void init_clsok(){clsok=false;};
bool tomar_tiempo(int intervalo); 
void showframe();
void initfondo();

void logger_open(char spriteID[256]);
void logger_write(char* txt);
void logger_close();
bool INISDL_OK(HWND hwnd);
bool BeginDraw(int largo,int alto,int colordepth,HWND handler);
int minlimiter(int min,int valor);
int maxlimiter(int max,int valor);
int limiterpacman(int max,int valor);
};


cuadro_princi.screen is a SDL_Surface*


Thanks a lot!.










> 
> Ken Rogoway
> Homebrew Software
> http://www.homebrewsoftware.com/
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.487 / Virus Database: 269.13.16/1005 - Release Date: 9/13/2007
> 11:45 AM
> 






More information about the SDL mailing list