From a5324462c35ebb15651f1bb951543cc4c688f831 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 16 Jan 2012 17:28:40 -0500 Subject: [PATCH] iconGrid: avoid recreating icons unnecessarily Add a short-circuit when the size doesn't change. Taken from part of 26580f8f2c (Giovanni Campagna). This greatly reduces the reentrancy of recreating icons that seems to be responsible for many crashers, though the exact mechanism for the crashes isn't clear. See: https://bugzilla.gnome.org/show_bug.cgi?id=648450 https://bugzilla.redhat.com/show_bug.cgi?id=707652 https://bugzilla.redhat.com/show_bug.cgi?id=781780 --- js/ui/iconGrid.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js index 765bd2b1e..e65f9668a 100644 --- a/js/ui/iconGrid.js +++ b/js/ui/iconGrid.js @@ -147,6 +147,11 @@ BaseIcon.prototype = { size = found ? len : ICON_SIZE; } + // don't create icons unnecessarily + if (size == this.iconSize && + this._iconBin.child) + return; + this._createIconTexture(size); } };