Declare the EnumValues for PixelFormat static
authorJonathan Matthew <notverysmart@gmail.com>
Tue, 24 Feb 2009 09:25:53 +0000 (09:25 +0000)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Tue, 24 Feb 2009 09:29:08 +0000 (09:29 +0000)
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 <ebassi@linux.intel.com>
clutter/cogl/common/cogl-util.c

index 07978df..9cb96d1 100644 (file)
@@ -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" },