Re: closure floating



Karl Nelson <kenelson ece ucdavis edu> writes: 
> This seems unlikely, but then is it?
> It is a distinct possibility if you consider the case of
> assertions.
> 
> void foobar(GtkWidget* w, GClosure* c)
>   {
>     /*...*/
>     g_return_if_fail(w!=0);
>     /*...*/
>     g_signal_connect ....
>   }

That doesn't make any difference, we don't guarantee any kind of sane
behavior after an assertion has bombed; usually it segfaults, so a
memory leak is a relatively mild breakdown.

If passing 0 was allowed, the function wouldn't warn about it.

Havoc




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