On Mon, 22 Sep 2003 02:18:34 -0700 "Bowie J. Poag" <[EMAIL PROTECTED]> babbled:

> 
> Howdy, gang. Got a question for the group...Hopefully someone here can 
> help me figure out this little puzzle.

ok. we COULD fix it. but we basically don't want to because we'll say
"use imlib2". :) imlib1 is not being maintained actively as such and i do NOT
encourage anyone to be writing software using it when theres significantly
better stuff out there. :)

> 
> The following is a simple function that makes an Imlib image (a little 
> icon) flash X number of times.
> This function leaks memory like crazy.. I've pinned it down to 
> Imlib_paste_image().
> Any ideas as to what i'm forgetting to do here? The code is as follows:
> 
> 
> 
> // (Note: "buffer" and "bufferData" are analogous to "im" and "id" in 
> your examples, respectively... and "icon[0].image" is analogous to "im".)
> 
> void strobeThisIcon(int uniqueID, int strobeCycles)
> {
>         int originalBrightness;
> 
>         buffer=icon[0].image;
>         Imlib_get_image_modifier(bufferData,buffer,&mod);
>         originalBrightness=mod.brightness;
> 
>         while(strobeCycles!=0)
>         {
>                         while(mod.brightness<320)
>                         {
>                                 
> Imlib_set_image_modifier(bufferData,buffer,&mod);
>                                
>  Imlib_paste_image(bufferData,buffer,win,0,0,64,64);
>                                 mod.brightness=mod.brightness+25;
>                         }
> 
> 
>                         while(mod.brightness>=originalBrightness)
>                         {
>                                 
> Imlib_set_image_modifier(bufferData,buffer,&mod);
>                                 
> Imlib_paste_image(bufferData,buffer,win,0,0,64,64);
>                                 mod.brightness=mod.brightness-25;
>                         }
> 
>                         strobeCycles--;
>         }
> 
>         XSync(disp,False);
> 
> }
> 
> 
> PS.. If you want to see the leak in action, grab the latest Pogo:
> 
> http://www.ibiblio.org/propaganda/pogo/pogo-2.1.tar.gz
> 
> ...and hardwire main() to just hit strobeThisIcon() in an infinite loop.
> 
> Build it, and have a look at it in memprof. Leak city.
> 
> Cheers,
> Bowie
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> enlightenment-devel mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


-- 
--------------- Codito, ergo sum - "I code, therefore I am" --------------------
The Rasterman (Carsten Haitzler)    [EMAIL PROTECTED]
熊耳 - 車君                         [EMAIL PROTECTED]
Mobile Phone: +61 (0)413 451 899    Home Phone: 02 9698 8615


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
enlightenment-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to