Jeckky / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

Image cache reused after being cleared. #431

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Create a PDF with images, destroy the dompdf object then create another PDF 
using the same images from within the same working script.  The cached images 
are removed but the cache array is not resulting in the 2nd creating failing to 
read the images.

What version of dompdf are you using? 

This affects the current trunk as well as an old copy I had back from early 
last year.  

Fix is to reset the array in the Image_Cache::clear()

static function clear() {    
    if ( empty(self::$_cache) || DEBUGKEEPTEMP ) return;

    foreach ( self::$_cache as $file ) {
      if (DEBUGPNG) print "[clear unlink $file]";
      unlink($file);      
    }

    @@ self::$_cache = array();
  }

Original issue reported on code.google.com by mechjag...@gmail.com on 21 Feb 2012 at 8:57

GoogleCodeExporter commented 8 years ago
You are right, my mistake! I didn't notice that the array was emptied, when I 
did a refactoring of this class.

Original comment by fabien.menager on 21 Feb 2012 at 9:28

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r478.

Original comment by fabien.menager on 21 Feb 2012 at 9:30

GoogleCodeExporter commented 8 years ago
Issue 502 has been merged into this issue.

Original comment by eclecticgeek on 21 Jun 2012 at 6:52

GoogleCodeExporter commented 8 years ago
Issue 527 has been merged into this issue.

Original comment by eclecticgeek on 20 Aug 2012 at 3:36

GoogleCodeExporter commented 8 years ago
Issue 559 has been merged into this issue.

Original comment by eclecticgeek on 11 Dec 2012 at 3:16

GoogleCodeExporter commented 8 years ago

Original comment by eclecticgeek on 30 May 2013 at 5:16