Re: Warnings/Errors during Threaded Execution

I'm guessing that you're accessing some widgets in a separate thread (or in your callbacks).  Whenever you do this, you need to lock the widgets so that you're not modifying them while they are trying to be drawn.  So in a callback, you need
// the code that is needed for the callback
or, when you're in the thread that you started, you need to do the same thing anytime that you're accessing widgets.
One last thing, in your main program, make sure that you do the following...
This way, the main loop runs correctly with threads.
I can't promise that this is the textbook example of how to work with multithreads, but it's what I got working after many hours of trial & error.

Christopher Bland <themanatuf juno com> wrote:
From: "Christopher Bland" <themanatuf juno com>
Date: Thu, 30 Nov 2006 17:17:39 GMT
To: gtk-devel-list gnome org
Subject: Warnings/Errors during Threaded Execution

I've searched these lists as well as Google but am unable to find
anything to point me in the right direction...

I created a GTK+ app in C with all commands running sequentially. The
app behaved perfectly and I never received any errors/warnings. I have
started to make the app multi-threaded and followed the docs at:

The messages:

(aurora:14553): GLib-GObject-WARNING **: IA__g_object_thaw_notify:
property-changed notification for GtkLabel(0x80c5d20) is not frozen

(aurora:30975): GLib-GObject-CRITICAL **: g_object_unref: assertion
`object->ref_count > 0' failed

The code is kind of large and I could attempt to "dumb" it down if
needed. Basically it is a window with a few labels, textboxes and 3
buttons. One button starts the app's processing, the other stops the
processing, and the third just clears the textboxes.

Clicking the first button fires the 'clicked' event where I make the
following calls:


A few lines later I create my threads and go:

if ((t_g1 = g_thread_create((GThreadFunc)process, NULL, TRUE, &err1))
== NULL)

Those lines are the only ones I added (other than
gdk_threads_enter()/gdk_threads_leave() in my timer and callbacks).

If anyone has seen these messages before and can point me in a
direction to fix it I would greatly appreciate it. Thank you very much!

Try Juno Platinum for Free! Then, only $9.95/month!
Unlimited Internet Access with 1GB of Email Storage.
Visit to sign up today!

gtk-devel-list mailing list
gtk-devel-list gnome org

Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.

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