summaryrefslogtreecommitdiffstats
path: root/lib/image.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-03-26 22:33:37 +0200
committerRobin Appelman <icewind@owncloud.com>2012-03-26 22:33:37 +0200
commit0ba93323585cd277d845eb7d7600cd4cac4f84da (patch)
tree4877ebe2ee0e4a4d4612b9a14c0d7e318a621d2a /lib/image.php
parent0c19e44a61229fe1376c8436b8a73e974b424539 (diff)
downloadnextcloud-server-0ba93323585cd277d845eb7d7600cd4cac4f84da.tar.gz
nextcloud-server-0ba93323585cd277d845eb7d7600cd4cac4f84da.zip
some more memory cleanup in OC_Image
Diffstat (limited to 'lib/image.php')
-rw-r--r--lib/image.php6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/image.php b/lib/image.php
index 62f35b4fc99..4717f81af7d 100644
--- a/lib/image.php
+++ b/lib/image.php
@@ -317,10 +317,7 @@ class OC_Image {
*/
public function loadFromFileHandle($handle) {
OC_Log::write('core',__METHOD__.'(): Trying', OC_Log::DEBUG);
- $contents = '';
- while (!feof($handle)) {
- $contents .= fread($handle, 8192);
- }
+ $contents = stream_get_contents($handle);
if($this->loadFromData($contents)) {
return $this->resource;
}
@@ -486,6 +483,7 @@ class OC_Image {
imagedestroy($process);
return false;
}
+ imagedestroy($this->resource);
$this->resource = $process;
return true;
}