Re: [gnome-db]memory leak



On 17 Mar 2001 15:17:13 +0100, Daniel Wagner wrote:
> Hi,
> 
> I'm bit confused about following code. When I check for memory leaks,
> memprof finds some. What's wrong? 
> BTW the code is from gnome-db/lib/gnome-db-login.
> 
> #include <glib.h>
> #include <gda-common.h>
> #include <liboaf/liboaf.h>
> 
> void print_string (gpointer data, gpointer user_data)
> {
>   /* do something */
>   printf ("%s\n", (char*)data);
> }
> 
> int main (int argc, char **argv) 
> {
>   GList *list = NULL;
> 
>   oaf_init (argc, argv);
> 
>   list = gda_list_datasources ();
>   g_list_foreach (list, (GFunc)print_string, 0);
>   g_list_foreach (list, (GFunc)g_free, 0);
>   g_list_free (list);
>               
>   return 0;
> }
> 
yes, it's strange, there shouldn't be memory leaks, as you're freeing the memory

correctly. What functions does memprof say the leak is in?

cheers


-- 
Rodrigo Moya <rodrigo gnome-db org> <rodrigo ximian com>
http://www.gnome-db.org/





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