summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 22:55:48 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-11 22:55:48 +0000
commitd72aa00d29a465e37454afc6db6d1080c62051e3 (patch)
tree3b268802c4bf75328244a765bf09697ad4d4782c /base
parenta7cc2738d2e280f479796be3a4b1ae87343eb938 (diff)
downloadchromium_src-d72aa00d29a465e37454afc6db6d1080c62051e3.zip
chromium_src-d72aa00d29a465e37454afc6db6d1080c62051e3.tar.gz
chromium_src-d72aa00d29a465e37454afc6db6d1080c62051e3.tar.bz2
Linux: fix icon theme double free on shutdown by eliminating dupes from icon theme array.
Simplify some code in DownloadItemGtk that I previously thought was related to the crash, and so had made complicated. Review URL: http://codereview.chromium.org/124001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/mime_util_linux.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/base/mime_util_linux.cc b/base/mime_util_linux.cc
index 4e849bf..a248bc0 100644
--- a/base/mime_util_linux.cc
+++ b/base/mime_util_linux.cc
@@ -511,6 +511,16 @@ void InitDefaultThemes() {
}
// hicolor needs to be last per icon theme spec.
default_themes[3] = IconTheme::LoadTheme("hicolor");
+
+ for (size_t i = 0; i < MimeUtilConstants::kDefaultThemeNum; i++) {
+ if (default_themes[i] == NULL)
+ continue;
+ // NULL out duplicate pointers.
+ for (size_t j = i + 1; j < MimeUtilConstants::kDefaultThemeNum; j++) {
+ if (default_themes[j] == default_themes[i])
+ default_themes[j] = NULL;
+ }
+ }
}
// Try to find an icon with the name |icon_name| that's |size| pixels.