From 3aea290adcbf7d12e6d8ec8230afbd8c3cb74606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 3 Aug 2018 17:52:19 +0200 Subject: [PATCH] extensionSystem: Unload stylesheet if extension is not loaded We should not keep any reference to an extension custom stylesheet in case we got an error while enabling that --- js/ui/extensionSystem.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index 3f23d273e..6611b5a63 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -136,6 +136,10 @@ function enableExtension(uuid) { _signals.emit('extension-state-changed', extension); return; } catch(e) { + if (extension.stylesheet) { + theme.unload_stylesheet(extension.stylesheet); + delete extension.stylesheet; + } logExtensionError(uuid, e); return; }