Re: gtk+-1.2.10 has memory leak?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel, John Cupitt and havardk ... Thank you all for your answer. Now I know it's no need to free a static string. But how about this one showed blow? It's from gdk.c. The argv_orig will not be freed if this function exit with false.(see //****//) Will this lead to a memory leak?

gboolean gdk_init_check (int *argc, char ***argv) { XKeyboardState keyboard_state; gint synchronize; gint i, j, k; XClassHint *class_hint; gchar **argv_orig = NULL; //****// ......

if (argc && argv) { argc_orig = *argc; argv_orig = g_malloc ((argc_orig + 1) * sizeof (char*)); //****//

for (i = 0; i < argc_orig; i++) argv_orig[i] = g_strdup ((*argv)[i]); argv_orig[argc_orig] = NULL; } .........

if (!gdk_display) return FALSE; //****//

.........

for (i = 0; i < argc_orig; i++) g_free(argv_orig[i]); //****// g_free(argv_orig); ......... return TRUE; }

_________________________________________________________________
免费下载 MSN Explorer: http://explorer.msn.com/lccn/


_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux