Skip to content

Commit

Permalink
cpdf_adapter cleans cache file more carefully
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-sokolov committed Jul 4, 2013
1 parent 54551d3 commit 1f81d9e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/cpdf_adapter.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,14 @@ function get_dompdf(){
*/
function __destruct() {
foreach ($this->_image_cache as $img) {
// The file might be already deleted by 3rd party tmp cleaner,
// the file might not have been created at all
// (if image outputting commands failed)
// or because the destructor was called twice accidentally.
if (!file_exists($img)) {
continue;
}

if (DEBUGPNG) print '[__destruct unlink '.$img.']';
if (!DEBUGKEEPTEMP) unlink($img);
}
Expand Down

0 comments on commit 1f81d9e

Please sign in to comment.