GNOME Bugzilla – Bug 655556
Memory leak in function cogl_polygon in cogl-primitives.c
Last modified: 2011-08-01 13:32:54 UTC
Created attachment 192856 [details] Fixed cogl-primitives.c Hi, I think the function cogl_polygon in file cogl-primitives.c is causing a memory leak (cogl version 1.7.4). - Line 1099 : g_strdup_printf ("cogl_tex_coord%d_in", i) The allocated string is never freeed. Should add "if (i >= 8) g_free (name);" at line 1109. - The CoglAttribute and CoglAttributeBuffer created are not destroyed, at the end of cogl_polygon function, should add : for (i = 0; i < n_attributes; i++) { cogl_object_unref (attributes[i]); } cogl_object_unref (attribute_buffer);
Created attachment 192881 [details] [review] cogl-primitives: Plug some leaks in cogl_polygon Thanks. Here are the same changes made into a patch.
Pushed as bbbe6db2847f36e0a. Thanks again.