From c3b840c368d50cb21f7410119a50443596baa537 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Mon, 21 Oct 2019 11:28:06 +0200 Subject: [PATCH] fix(ssr): memory leak, closes https://github.com/nuxt-community/apollo-module/issues/231 --- src/mixin.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mixin.js b/src/mixin.js index f18d90b8..7a1c7fe6 100644 --- a/src/mixin.js +++ b/src/mixin.js @@ -153,7 +153,11 @@ export function installMixin (Vue, vueVersion) { serverPrefetch () { if (this.$_apolloPromises) { - return Promise.all(this.$_apolloPromises) + return Promise.all(this.$_apolloPromises).then(result => { + // Destroy DollarApollo after SSR promises are resolved + destroy.call(this) + return result + }) } }, } : {},