From 191381f7da0b283fb471dc193c8cad009738be4f Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 12 Nov 2015 11:58:52 +0530 Subject: [PATCH] Prevent mem-leak in buttons Event handler should not have a reference to the DOM node in its context --- src/pyj/widgets.pyj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyj/widgets.pyj b/src/pyj/widgets.pyj index fd5bb9e93f..c6f2e59ef8 100644 --- a/src/pyj/widgets.pyj +++ b/src/pyj/widgets.pyj @@ -13,7 +13,7 @@ def create_button(text, icon=None, action=None, tooltip=None): text = '\xa0' + text ans = E.button(E.i(class_=cls), text, class_='calibre-push-button', type='button', title=tooltip or '') if action is not None: - ans.addEventListener('click', def(event): event.preventDefault(), action(event, ans);) + ans.addEventListener('click', def(event): event.preventDefault(), action(event);) return ans create_button.style = build_rule('button.calibre-push-button',