Re: Thread created by g_thread _create() cannot write to memory
- From: Sebastian Wilhelmi <seppi seppi de>
- To: elmo <elmo_ poczta onet pl>
- Cc: gtk-list gnome org
- Subject: Re: Thread created by g_thread _create() cannot write to memory
- Date: Tue, 16 Aug 2005 13:42:56 +0200
Hi elmo,
First of all, see the corresponding FAQ entry
http://gtk.org/faq/#AEN482
Now for your program:
> gtk_init(&argc, &argv);
> g_thread_init(NULL);
Do:
g_thread_init(NULL);
gdk_threads_init();
gtk_init(&argc, &argv);
> gtk_main();
Do:
gdk_threads_enter();
gtk_main();
gdk_threads_leave();
> gtk_label_set_text( GTK_LABEL(ThisInst->timer_widget), "aaa"); //DOESN"T WORK! SEGFAULTS!
Do:
gdk_threads_enter();
gtk_label_set_text( GTK_LABEL(ThisInst->timer_widget), "aaa"); //WORK'S LIKE A CHARM!
gdk_threads_leave();
Bye,
Sebastian
--
Sebastian Wilhelmi | här ovanför alla molnen
mailto:seppi seppi de | är himlen så förunderligt blå
http://seppi.de |
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]