icontheme: Avoid creating useless IconThemeDirs
authorTimm Bäder <mail@baedert.org>
Sun, 1 Sep 2019 08:04:32 +0000 (10:04 +0200)
committerTimm Bäder <mail@baedert.org>
Mon, 9 Sep 2019 15:36:26 +0000 (17:36 +0200)
commitb65d9ca9559fa5dd9df1968a6fd06cb2e703b95f
tree22d5254f740b1698da9fefd94896f75bfefd5f10
parent0b472c23d7002395dfbd99a0371c22bc9bdcf89c
icontheme: Avoid creating useless IconThemeDirs

We were allocating IconThemeDir instances and then only later assign a
value to has_icons. In the !has_icons case, we were directly throwing
the IconThemeDir away again.

Delay allocating the IconThemeDirs until we know that it has icons.
This avoids allocating and then de-allocating around 1400 IconThemeDir
instances when opening the widget-factory.
gtk/gtkicontheme.c