Themuppeteer
Programmer
Hello,
I'm writing a GIF class as for easy and fast use of GIFs.
I found a good program called "gifview" and I dived into the code, but I have a memory leak.
In a loop that does somthing like this:
// BEGIN
mGifClass test;
test.setGif("logo.gif",win,x,y,display);//load GIF and
//put it into
//a pixmap
// for fast drawing
int i=0;
while(1){
i++;
if(i>500)i=0; //
test.setXY(i,i); // change coordinates
test.mdraw(); // draw gif on screen
}
In mdraw() there is only this:
mdraw(){
XCopyArea(display,pixmap,window,gc,0,0,width,height,winx,winy);
XFlush(display);
}
This loop works fine, but it uses memory (4k every 5000 GIFs drawn or so...)I've checked it with the TOP command, until nothing's
left and then the machine reboots... that was not the idea.
Does anyone know anything about this ?? I'd say the leak is into XCopyArea, does anyone know anything more about this ??
thanks.
I'm writing a GIF class as for easy and fast use of GIFs.
I found a good program called "gifview" and I dived into the code, but I have a memory leak.
In a loop that does somthing like this:
// BEGIN
mGifClass test;
test.setGif("logo.gif",win,x,y,display);//load GIF and
//put it into
//a pixmap
// for fast drawing
int i=0;
while(1){
i++;
if(i>500)i=0; //
test.setXY(i,i); // change coordinates
test.mdraw(); // draw gif on screen
}
In mdraw() there is only this:
mdraw(){
XCopyArea(display,pixmap,window,gc,0,0,width,height,winx,winy);
XFlush(display);
}
This loop works fine, but it uses memory (4k every 5000 GIFs drawn or so...)I've checked it with the TOP command, until nothing's
left and then the machine reboots... that was not the idea.
Does anyone know anything about this ?? I'd say the leak is into XCopyArea, does anyone know anything more about this ??
thanks.