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)

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

Reply via email to