diff --git a/extension.js b/extension.js index 64af7b6..73bd2fa 100644 --- a/extension.js +++ b/extension.js @@ -38,19 +38,16 @@ function init(extensionMeta) { } function enable() { - torControlClient = new TorControlClient(TOR_CONTROL_HOST, TOR_CONTROL_PORT); + torControlClient = new TorControlClient(TOR_CONTROL_HOST, TOR_CONTROL_PORT, true); torButton = new TorButton(torControlClient); Main.panel.addToStatusArea(torButton.Name, torButton); torControlClient.openConnection(); } function disable() { - if (torButton !== null) { + if (torControlClient !== null) + torControlClient.destroy(); + + if (torButton !== null) torButton.destroy(); - torButton = null; - } - if (torControlClient !== null) { - torControlClient.closeConnection(); - torControlClient = null; - } } diff --git a/tor_control_client.js b/tor_control_client.js index 4ef5abf..8749732 100644 --- a/tor_control_client.js +++ b/tor_control_client.js @@ -20,6 +20,7 @@ along with gnome-shell-extension-tor. If not, see