From: Alexander Ebert Date: Sat, 22 Oct 2016 15:10:49 +0000 (+0200) Subject: Fixed the most annoying GC issue ever X-Git-Tag: 3.0.0_Beta_4~33 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bf87f4ed729a22763ae015f70329fc29976f1526;p=GitHub%2FWoltLab%2FWCF.git Fixed the most annoying GC issue ever --- diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php index f19b72fdc9..bdcda157cf 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeWoltlabMetacode.class.php @@ -127,6 +127,13 @@ class HtmlInputNodeWoltlabMetacode extends AbstractHtmlInputNode { } DOMUtil::replaceElement($element, $newElement); + + // We're explicitly throwing away the doc fragment, as any remaining + // nodes will otherwise stick around for a while. They continue to exist + // until `createElement` or `createDocumentFragment` are called which + // cause an internal GC process that throws away the children, making + // the end of their lifetime unpredictable. Thanks PHP. + unset($fragment); } else { // attributes are invalid, remove element from DOM