Quote:
Originally Posted by ericshliao
Now, I have another guess: the problem might come from the GtkWidget and GdkPixbuf that I used to load and store image. It might because the old one is not cleared when I create a new one, even though I always re-use the same pointers to point to GtkWidget and GdkPixbuf.
Oh! I love Java. When I set a pointer or object to null, JVM will collect garbage automatically for me.
|
To debug this type of errors, valgrind (
http://valgrind.org/ ; "apt-get install valgrind") is of great help.
valgrind --leak-check=full --show-reachable=yes ./myprog 2>/tmp/valgrind.log
You will get at program exit the locations of the mallocs of the memory that was leaked. You have to compile your program with debugging information (i.e. "gcc -g myprog.c -o myprog")
The only catch is that you have to use a build of your program for x86 (not for arm/scratchbox), but I suppose that you already have the makefiles prepared for that to ease debugging :-)