Re: disable Gtk warnings



Am Sam, den 07.02.2004 schrieb Iago Rubio um 19:18:
El sáb, 07 de 02 de 2004 a las 18:44, Murilo Tuvani escribió:
I don´t agree with the *will* crash because I´m producing an
aplication and I sometimes apear some warnigs one case, when I pass
NULL to a pointer after make gtk_widget_destroy(), if I don´t pass it
will fail in tests I´ll make after and if I pass apear the gtk
warnings!

It seems that you're using, anywhere in your code, this pointer after
destroying the widget.

This way, when you don't equals to NULL the pointer, some function is
called with an invalid widget pointer, and it don't warns.

When you equals it to NULL the function is called with a NULL pointer so
the warnings appear.

The hint is to find where in your code you're calling a function with
and invalid widget pointer and fix it.

This way you'll get two benefits: your program will be more robust and
better written, you problem with the warnings will be solved :)

A gdb session will help.

A good way to find this warnings is to run the program in gdb with:

run --g-fatal-warnings

This will segfault the program, use "bt" to find the line in which the
segfault appears.

Warnings should never appear in a good written application.

-- 
Fritz "der mit dem Linux tanzt" Ganter         http://www.gpsdrive.de
 Key fingerprint = 555A DDBB 3985 16FF CD41  2031 C485 1783 BF34 728F




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