From c381fbf689f4a73b6317852390747ef0ee6fe7b5 Mon Sep 17 00:00:00 2001 From: Jens Lody Date: Sun, 1 Nov 2015 23:17:17 +0100 Subject: [PATCH] Abort pending request(s), before adding a new one. --- src/extension.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/extension.js b/src/extension.js index f1d4f42..0324f42 100644 --- a/src/extension.js +++ b/src/extension.js @@ -1030,12 +1030,14 @@ const OpenweatherMenuButton = new Lang.Class({ if (_httpSession === undefined) { _httpSession = new Soup.Session(); _httpSession.user_agent = this.user_agent; + } else { + // abort previous requests. + _httpSession.abort(); } let message = Soup.form_request_new_from_hash('GET', url, params); _httpSession.queue_message(message, Lang.bind(this, function(_httpSession, message) { - try { if (!message.response_body.data) { fun.call(this, 0);