From ecc297635f13ac0bc60861570d0e93313a491cec Mon Sep 17 00:00:00 2001 From: Norman Fomferra Date: Tue, 6 Jun 2017 17:42:12 +0200 Subject: [PATCH] Fixed bug caused by wrong scoping Fixed a bug related to potentially wrong variable scope where the inner `this` of a function is used instead of the `this` of the outer scope. --- lib/matplotlib/backends/web_backend/mpl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/web_backend/mpl.js b/lib/matplotlib/backends/web_backend/mpl.js index cecebd8e0201..cde766b88f12 100644 --- a/lib/matplotlib/backends/web_backend/mpl.js +++ b/lib/matplotlib/backends/web_backend/mpl.js @@ -77,7 +77,7 @@ mpl.figure = function(figure_id, websocket, ondownload, parent_element) { }; this.imageObj.onunload = function() { - this.ws.close(); + fig.ws.close(); } this.ws.onmessage = this._make_on_message_function(this);