Hi,
When i run my gtk app, sometimes to program
crashes because of an Xlib error. Now i know this has to do with thread
synchronization, and I heard that only 1 thread can access gtk functions at a
time. So i went online, and I found an example which used pthreads. and that
noted just to use gdk_thread_init, at the and gdk_thread_enter and
gdk_thread_leave before and after gtk_main, respectively. While this method
compiled, I get an immediate Segmentation fault as soon as I run my program.
Currently, I only use gdb as a debugger, and that hasn't helped. any ideas to
beat this Xlib problem? thanks!
|