Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorElijah Martin-Merrill <elijah@nyp-itsours.com>2020-07-27 17:52:44 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-08-05 23:41:25 +0300
commit66bb6fdbb017b04382cb477944a33b0c83b5bebd (patch)
treef6baed8dc738667851d0ef56c9d8c7bf9d5f91c3 /lib
parent02680cf93d7ba38a467d8f505424eb357cee5816 (diff)
fix memory leak caused by not destroying image in Preview/Generate.php
Signed-off-by: Elijah Martin-Merrill <elijah@nyp-itsours.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Preview/Generator.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/Preview/Generator.php b/lib/private/Preview/Generator.php
index f7aed987d89..45e991d551d 100644
--- a/lib/private/Preview/Generator.php
+++ b/lib/private/Preview/Generator.php
@@ -192,6 +192,12 @@ class Generator {
}
}
+ // Free memory being used by the embedded image resource. Without this the image is kept in memory indefinitely.
+ // Garbage Collection does NOT free this memory. We have to do it ourselves.
+ if ($maxPreviewImage instanceof IImage) {
+ $maxPreviewImage->destroy();
+ }
+
return $preview;
}