From 3b403775ff0eb0e3ed4f4fa8f74cec646b568f57 Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Mon, 4 Sep 2017 14:06:09 +0200 Subject: [PATCH] [style] Fix memory leak (#8036) --- src/styles/withStyles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/styles/withStyles.js b/src/styles/withStyles.js index 58fb62c027c0cf..cda87f382067b0 100644 --- a/src/styles/withStyles.js +++ b/src/styles/withStyles.js @@ -225,7 +225,7 @@ function withStyles(stylesOrCreator: Object, options?: Options = {}) { if (sheetManagerTheme.refs === 0) { sheetManager.delete(theme); - sheetManagerTheme.sheet.detach(); + this.jss.removeStyleSheet(sheetManagerTheme.sheet); const sheetsRegistry = this.context[ns.sheetsRegistry]; if (sheetsRegistry) { sheetsRegistry.remove(sheetManagerTheme.sheet);