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:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-08-13 06:23:01 +0300
committerGitHub <noreply@github.com>2020-08-13 06:23:01 +0300
commit92d0f5e7a3b610f224064447c737565b837a1ba3 (patch)
tree5287946f869225d760e34aa3d8cf07f865bbf38c /lib
parent1d123c0ccb50acff1351fb7c828ab9549f00f86a (diff)
parent9aff51eb52d531a576158d02a6cb626167a3de00 (diff)
Merge pull request #22121 from nextcloud/backport/22008/stable19
[stable19] Ensured large image is unloaded from memory when generating previews
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..e47a7e5927c 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 \OC_Image) {
+ $maxPreviewImage->destroy();
+ }
+
return $preview;
}