From 3c1f389e25636e475e958f321a20b6d5bcb0f304 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Mon, 1 Apr 2013 23:57:55 -0400 Subject: [PATCH] backgroundMenu: destroy menu when actor is destroyed This fixes a leak. https://bugzilla.gnome.org/show_bug.cgi?id=697119 --- js/ui/backgroundMenu.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/js/ui/backgroundMenu.js b/js/ui/backgroundMenu.js index cc6c65397..538abd5b9 100644 --- a/js/ui/backgroundMenu.js +++ b/js/ui/backgroundMenu.js @@ -55,4 +55,10 @@ function addBackgroundMenu(actor) { openMenu(); }); actor.add_action(clickAction); + + actor.connect('destroy', function() { + actor._backgroundMenu.destroy(); + actor._backgroundMenu = null; + actor._backgroundManager = null; + }); }