Re: why my program quit when I use g_thread?



Um, I don't know much about g_thread, but you code is flawed:

if (!g_thread_supported())
g_thread_init();

In other words if g_thread is not supported then init g_thread...
I think you want:

if (g_thread_supported())
g_thread_init();

Unless I got something all wrong here...

Hope this Helps

Daniel Pekelharing

On Wed, 2005-05-18 at 20:03 +0800, éç å wrote:
when I add these code,my program will crash at the
start, and report segments falt?:

if (!g_thread_supported())
g_thread_init();

gdk_thread_enter();
gtk_set_local();
gtk_init();
/* init my gtk window here */
gtk_main();
gdk_thread_leave();
return;

But it work fine if I remove these and use single thread?






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