Commit b060715d authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer
Browse files

connect to the display's "closed" signal and free the cached scratch

2006-01-12  Michael Natterer  <mitch@imendio.com>

	* gdk/gdkimage.c (scratch_image_info_for_depth): connect to the
	display's "closed" signal and free the cached scratch images upon
	display closing (bug #85715).
parent 19454762
2006-01-12 Michael Natterer <mitch@imendio.com>
* gdk/gdkimage.c (scratch_image_info_for_depth): connect to the
display's "closed" signal and free the cached scratch images upon
display closing (bug #85715).
2006-01-12 Michael Natterer <mitch@imendio.com> 2006-01-12 Michael Natterer <mitch@imendio.com>
* gtk/gtkexpander.c (gtk_expander_set_expanded): skip the * gtk/gtkexpander.c (gtk_expander_set_expanded): skip the
......
2006-01-12 Michael Natterer <mitch@imendio.com>
* gdk/gdkimage.c (scratch_image_info_for_depth): connect to the
display's "closed" signal and free the cached scratch images upon
display closing (bug #85715).
2006-01-12 Michael Natterer <mitch@imendio.com> 2006-01-12 Michael Natterer <mitch@imendio.com>
* gtk/gtkexpander.c (gtk_expander_set_expanded): skip the * gtk/gtkexpander.c (gtk_expander_set_expanded): skip the
......
...@@ -226,6 +226,25 @@ allocate_scratch_images (GdkScratchImageInfo *info, ...@@ -226,6 +226,25 @@ allocate_scratch_images (GdkScratchImageInfo *info,
return TRUE; return TRUE;
} }
static void
scratch_image_info_display_closed (GdkDisplay *display,
gboolean is_error,
GdkScratchImageInfo *image_info)
{
gint i;
g_signal_handlers_disconnect_by_func (display,
scratch_image_info_display_closed,
image_info);
scratch_image_infos = g_slist_remove (scratch_image_infos, image_info);
for (i = 0; i < image_info->n_images; i++)
g_object_unref (image_info->static_image[i]);
g_free (image_info);
}
static GdkScratchImageInfo * static GdkScratchImageInfo *
scratch_image_info_for_depth (GdkScreen *screen, scratch_image_info_for_depth (GdkScreen *screen,
gint depth) gint depth)
...@@ -249,6 +268,10 @@ scratch_image_info_for_depth (GdkScreen *screen, ...@@ -249,6 +268,10 @@ scratch_image_info_for_depth (GdkScreen *screen,
image_info->depth = depth; image_info->depth = depth;
image_info->screen = screen; image_info->screen = screen;
g_signal_connect (gdk_screen_get_display (screen), "closed",
G_CALLBACK (scratch_image_info_display_closed),
image_info);
/* Try to allocate as few possible shared images */ /* Try to allocate as few possible shared images */
for (i=0; i < G_N_ELEMENTS (possible_n_images); i++) for (i=0; i < G_N_ELEMENTS (possible_n_images); i++)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment