some more memory cleanup in OC_Image
This commit is contained in:
parent
0c19e44a61
commit
0ba9332358
|
@ -317,10 +317,7 @@ class OC_Image {
|
||||||
*/
|
*/
|
||||||
public function loadFromFileHandle($handle) {
|
public function loadFromFileHandle($handle) {
|
||||||
OC_Log::write('core',__METHOD__.'(): Trying', OC_Log::DEBUG);
|
OC_Log::write('core',__METHOD__.'(): Trying', OC_Log::DEBUG);
|
||||||
$contents = '';
|
$contents = stream_get_contents($handle);
|
||||||
while (!feof($handle)) {
|
|
||||||
$contents .= fread($handle, 8192);
|
|
||||||
}
|
|
||||||
if($this->loadFromData($contents)) {
|
if($this->loadFromData($contents)) {
|
||||||
return $this->resource;
|
return $this->resource;
|
||||||
}
|
}
|
||||||
|
@ -486,6 +483,7 @@ class OC_Image {
|
||||||
imagedestroy($process);
|
imagedestroy($process);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
imagedestroy($this->resource);
|
||||||
$this->resource = $process;
|
$this->resource = $process;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue