Skip to content

memory leak found while run in php_cli mode #24

@lilien1010

Description

@lilien1010
function checkQrCode($filename,$mid){ 
        if(false==file_exists($filename)){
            return false;
        } 
        $QRimage    = new ZBarCodeImage($filename);

        $QRscanner  = new ZBarCodeScanner();

        try{ 
            $barcode = $QRscanner->scan($QRimage); 
        }catch(Exception $e){
            $barcode    =   false; 
            zLog(HT_ERROR,' e = '.$e->getMessage(),__FUNCTION__,__LINE__); 
        }

        $QRimage->clear();
        $QRscanner  =   null;
        $QRimage    =   null;
        unset($QRscanner);
        unset($QRimage);

        if (!empty($barcode)) {
              //handle barcode          
        } 
        return false; 
    }

while I call the function in a loop to check amount of files, the memory keep increasing.
,is there any wrong with my code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions