From ee3647f84da28253d754c0154d254c7ead8a7f83 Mon Sep 17 00:00:00 2001 From: Jonathan Matthew Date: Tue, 24 Feb 2009 09:25:53 +0000 Subject: [PATCH] Declare the EnumValues for PixelFormat static Bug 1473 - CoglPixelFormat enum data must be declared static When registering an enumeration GType, the GEnumValue or GFlagsValue arrays must be declared static; otherwise, you get a segmentation fault when calling the function again. Signed-off-by: Emmanuele Bassi --- common/cogl-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/cogl-util.c b/common/cogl-util.c index 07978dfbf..9cb96d192 100644 --- a/common/cogl-util.c +++ b/common/cogl-util.c @@ -122,7 +122,7 @@ cogl_pixel_format_get_type (void) if (G_UNLIKELY (gtype == 0)) { - const GEnumValue values[] = { + static const GEnumValue values[] = { { COGL_PIXEL_FORMAT_ANY, "COGL_PIXEL_FORMAT_ANY", "any" }, { COGL_PIXEL_FORMAT_A_8, "COGL_PIXEL_FORMAT_A_8", "a-8" }, { COGL_PIXEL_FORMAT_RGB_565, "COGL_PIXEL_FORMAT_RGB_565", "rgb-565" },