Re: [gtk-list] Re: suggestion/request: gtk_init returns on failure



On Fri, Feb 19, 1999 at 01:35:13AM +0100, Jan Kratochvil wrote:
...
> static void gdk_recovery(void)
> {
>         dbg(printf("gdk_recovery!!!\n"));
>         if (isinit) {
>                 dbg(printf("already inited/failed\n"));
>                 return;
>                 }
>         longjmp(jumpbuffer,1);
> }
> 
> void init_that_mess(int *argcp,char ***argvp)
> {
>         if (isinit||setjmp(jumpbuffer)) {
>                 dbg(printf("failing...\n"));
>                 isinit=1;
>                 return(FALSE);
>                 }
> 
>         dbg(printf("gtk_init...\n"));
>         atexit(gdk_recovery);
>         gtk_init(argcp,argvp);
>         dbg(printf("gtk_inited.\n"));
>         isinit=2;
>         return(TRUE);
> }


ugh, this is worse than just being a horrible hack. :)  really, we
need to have GTK implement the functionality the correct way, such
that no one would need to resort to this type of obscene code.
--andy



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