From e003ba87d14cee3b078e06374aa45cf6287f1e41 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Sat, 11 Jun 2005 02:28:04 +0000 Subject: Prevent using the address of a local variable as a hash key. (Bug #307209) 2005-06-10 Ryan Lortie * src/frames.c: Prevent using the address of a local variable as a hash key. (Bug #307209) * src/xprops.c (meta_prop_get_values): Fix a small leak in the case of a SYNC_COUNTER property value and HAVE_XSYNC not defined. (Bug #307214) --- src/frames.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/frames.c') diff --git a/src/frames.c b/src/frames.c index e37e48fa5..6c463902f 100644 --- a/src/frames.c +++ b/src/frames.c @@ -188,7 +188,7 @@ meta_frames_init (MetaFrames *frames) { GTK_WINDOW (frames)->type = GTK_WINDOW_POPUP; - frames->text_heights = g_hash_table_new (g_int_hash, g_int_equal); + frames->text_heights = g_hash_table_new (NULL, NULL); frames->frames = g_hash_table_new (unsigned_long_hash, unsigned_long_equal); @@ -296,7 +296,7 @@ meta_frames_font_changed (MetaFrames *frames) if (g_hash_table_size (frames->text_heights) > 0) { g_hash_table_destroy (frames->text_heights); - frames->text_heights = g_hash_table_new (g_int_hash, g_int_equal); + frames->text_heights = g_hash_table_new (NULL, NULL); } /* Queue a draw/resize on all frames */ @@ -395,9 +395,9 @@ meta_frames_ensure_layout (MetaFrames *frames, meta_prefs_get_titlebar_font ()); size = pango_font_description_get_size (font_desc); - + if (g_hash_table_lookup_extended (frames->text_heights, - &size, + GINT_TO_POINTER (size), &key, &value)) { frame->text_height = GPOINTER_TO_INT (value); @@ -409,7 +409,7 @@ meta_frames_ensure_layout (MetaFrames *frames, gtk_widget_get_pango_context (widget)); g_hash_table_replace (frames->text_heights, - &size, + GINT_TO_POINTER (size), GINT_TO_POINTER (frame->text_height)); } -- cgit v1.2.1