forked from AuroraMiddleware/gtk
image: Invalidate icon helper when unrealizing
This frees up any cached surfaces and textures in the iconhelper, ensuring that the renderer can release its texture data.
This commit is contained in:
parent
c0aa065ac1
commit
4b8b06bb08
@ -48,7 +48,7 @@ struct _GtkIconHelperPrivate {
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (GtkIconHelper, gtk_icon_helper, GTK_TYPE_CSS_GADGET)
|
||||
|
||||
static void
|
||||
void
|
||||
gtk_icon_helper_invalidate (GtkIconHelper *self)
|
||||
{
|
||||
g_clear_pointer (&self->priv->texture, gsk_texture_unref);
|
||||
|
@ -132,6 +132,7 @@ gboolean _gtk_icon_helper_get_force_scale_pixbuf (GtkIconHelper *self);
|
||||
void _gtk_icon_helper_set_force_scale_pixbuf (GtkIconHelper *self,
|
||||
gboolean force_scale);
|
||||
|
||||
void gtk_icon_helper_invalidate (GtkIconHelper *self);
|
||||
void gtk_icon_helper_invalidate_for_change (GtkIconHelper *self,
|
||||
GtkCssStyleChange *change);
|
||||
|
||||
|
@ -1297,7 +1297,12 @@ gtk_image_unmap (GtkWidget *widget)
|
||||
static void
|
||||
gtk_image_unrealize (GtkWidget *widget)
|
||||
{
|
||||
gtk_image_reset_anim_iter (GTK_IMAGE (widget));
|
||||
GtkImage *image = GTK_IMAGE (widget);
|
||||
GtkImagePrivate *priv = image->priv;
|
||||
|
||||
gtk_image_reset_anim_iter (image);
|
||||
|
||||
gtk_icon_helper_invalidate (priv->icon_helper);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_image_parent_class)->unrealize (widget);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user