summaryrefslogtreecommitdiff
path: root/src/frames.c
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2005-06-11 02:28:04 +0000
committerRyan Lortie <ryanl@src.gnome.org>2005-06-11 02:28:04 +0000
commite003ba87d14cee3b078e06374aa45cf6287f1e41 (patch)
tree96a771e4e23f27923108c6c22c975727133e4823 /src/frames.c
parent064a86e6203d21ed82a80da37e48925269317d60 (diff)
downloadmutter-e003ba87d14cee3b078e06374aa45cf6287f1e41.tar.gz
Prevent using the address of a local variable as a hash key. (Bug #307209)
2005-06-10 Ryan Lortie <desrt@desrt.ca> * 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)
Diffstat (limited to 'src/frames.c')
-rw-r--r--src/frames.c10
1 files changed, 5 insertions, 5 deletions
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));
}