aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Welinder <terra@diku.dk>2000-09-18 10:26:00 +0800
committerMorten Welinder <mortenw@src.gnome.org>2000-09-18 10:26:00 +0800
commit645f6e47ea513495f428f9299c5e4ec89dac9891 (patch)
tree8d27d3c6bf0cadbc03c5881beba810d50d6fa392
parent3df5e4a687d4cc046804f6effa1eae832eb0504a (diff)
downloadgsoc2013-evolution-645f6e47ea513495f428f9299c5e4ec89dac9891.tar.gz
gsoc2013-evolution-645f6e47ea513495f428f9299c5e4ec89dac9891.tar.zst
gsoc2013-evolution-645f6e47ea513495f428f9299c5e4ec89dac9891.zip
Leak prevention.
2000-09-17 Morten Welinder <terra@diku.dk> * src/widgets/e-colors.c (e_color_init): Don't leak if called twice. svn path=/trunk/; revision=5489
-rw-r--r--widgets/misc/e-colors.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/widgets/misc/e-colors.c b/widgets/misc/e-colors.c
index 4154b1bf3d..c7a79003ae 100644
--- a/widgets/misc/e-colors.c
+++ b/widgets/misc/e-colors.c
@@ -60,8 +60,14 @@ e_color_alloc_name (const char *name, GdkColor *c)
void
e_color_init (void)
{
- GdkColormap *colormap = gtk_widget_get_default_colormap ();
-
+ GdkColormap *colormap;
+
+ /* It's surprisingly easy to end up calling this twice. Survive. */
+ if (e_color_inited)
+ return;
+
+ colormap = gtk_widget_get_default_colormap ();
+
/* Initialize the color context */
e_color_context = gdk_color_context_new (
gtk_widget_get_default_visual (), colormap);