Merge branch 'matthiasc/for-main' into 'main'

gsk: Plug a memory leak

See merge request GNOME/gtk!4616
This commit is contained in:
Matthias Clasen 2022-04-03 14:21:13 +00:00
commit a6e47892be
2 changed files with 11 additions and 4 deletions

View File

@ -348,7 +348,7 @@ gsk_gl_driver_load_programs (GskGLDriver *self,
/* Use XMacros to register all of our programs and their uniforms */
#define GSK_GL_NO_UNIFORMS
#define GSK_GL_SHADER_RESOURCE(name) \
g_bytes_ref(g_resources_lookup_data("/org/gtk/libgsk/gl/" name, 0, NULL))
g_resources_lookup_data("/org/gtk/libgsk/gl/" name, 0, NULL)
#define GSK_GL_SHADER_STRING(str) \
g_bytes_new_static(str, strlen(str))
#define GSK_GL_SHADER_SINGLE(bytes) \

View File

@ -69,11 +69,18 @@ gtk_css_calc_value_new_from_array (GtkCssValue **values,
return result;
}
static void
gtk_css_value_number_free (GtkCssValue *value)
gtk_css_value_number_free (GtkCssValue *number)
{
g_slice_free (GtkCssValue, value);
if (number->type == TYPE_CALC)
{
const guint n_terms = number->calc.n_terms;
for (guint i = 0; i < n_terms; i++)
_gtk_css_value_unref (number->calc.terms[i]);
}
g_slice_free (GtkCssValue, number);
}
static double