From fceb40cd2c92b01b6141ff3d6a27f47031dfa228 Mon Sep 17 00:00:00 2001 From: Matt Garrett Date: Wed, 14 Aug 2024 07:39:44 -0700 Subject: [PATCH] fix: (@vue/apollo-option) memory leak in wrapped ssrRender (#1553) --- packages/vue-apollo-option/src/mixin.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/vue-apollo-option/src/mixin.js b/packages/vue-apollo-option/src/mixin.js index a2ecc8aa..02555158 100644 --- a/packages/vue-apollo-option/src/mixin.js +++ b/packages/vue-apollo-option/src/mixin.js @@ -115,11 +115,14 @@ export function installMixin (app, provider) { if (isServer) { // Patch render function to cleanup apollo const render = this.$options.ssrRender + if (!render) return + if (render.__IS_VUE_APOLLO_WRAPPED) return this.$options.ssrRender = (h) => { const result = render.call(this, h) destroy.call(this) return result } + this.$options.ssrRender.__IS_VUE_APOLLO_WRAPPED = true } },