Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XCopyArea -> memory leak

Status
Not open for further replies.

Themuppeteer

Programmer
Apr 4, 2001
449
BE
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top