On Fri, 25 Mar 2005 20:37:36 -0500 Julia Wolf <[EMAIL PROTECTED]>
babbled:

> Problem:
>   Each time that imlib_load_image() is called, in turn, each loader
> library is called. The loader library for bz2 files opens a temporary
> file "/tmp/imlib2_loader_bz2-XXXXXX" and then almost immediately deletes
> it. But is never closes the tempfile so lsof will show:
> 
> test-bin 28356 jwolf  3u      REG     3,2     0       213317 
> /tmp/imlib2_loader_bz2-55VbCn
(deleted)
> 
>   If you are calling imlib_load_image() many times in a loop -- say to
> convert a bunch of images -- you will end up with a new open filehandle
> to a deleted file each iteration. After 1024 iterations you run out of
> filehandles. (at the default ulimit)

ooh that is nasty! BAD bz2 loader. BAD!. thanks for pointing this out. i
re-arranged things to only 1. use this loader IF it ends in .bz2 AND to try load
the real file first before making the tmp file so if that fails you dont go and
make a tmp file anyway. :)

> Solution (maybe):
> 
> --- src/modules/loaders/loader_bz2.c.orig       2005-03-24 15:54:50.541223640
-0800
> +++ src/modules/loaders/loader_bz2.c    2005-03-24 15:54:50.541223640 -0800
> @@ -61,6 +61,7 @@
>                 return 0;
> 
>         if (!(fp = fopen (im->real_file, "rb"))) {
> +               close (dest);
>                 unlink (tmp);
>                 return 0;
>         }
> 
> I've tested this once and it seemed to fix the problem, but I'm not 100%
> certain that the new bz2.so was being called by imlib2.
> 
> Licence:
>   I hereby release the above patch into the Public Domain. You can even
> say you wrote it if you want.
> 
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> enlightenment-devel mailing list
> enlightenment-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    [EMAIL PROTECTED]
裸好多                              [EMAIL PROTECTED]
Tokyo, Japan (東京 日本)


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to