Re: why my program quit when I use g_thread?



Hi Danniel:
Thanks for your reply. I thinks this part is OK. It means if the g_thread is not initialized, it start to 
init it.
And I find if I change the function create_window to other much simple fucntion, it runs fine.
Now I wonder what types of works can not be done when the gthread is initialized?

Daniel Pekelharing <legendstar gmail com> 写道:
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?






---------------------------------
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
美女明星应有尽有,搜遍美图、艳图和酷图
1G就是1000兆,雅虎电邮自助扩容!


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