Re: gtk+-1.2.10 has memory leak?



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/



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