Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2001:
[Freeciv-Dev] Re: possible segfault and help!
Home

[Freeciv-Dev] Re: possible segfault and help!

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: possible segfault and help!
From: Kero van Gelder <kero@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 12 Mar 2001 22:56:33 +0100
Reply-to: kero@xxxxxx

> The question is why does this happen?

because you pass -1 as index?

> An workaround is to active a non-zero button before creating the signal
> (see below and attached patch), but I'd like to know if there's a direct 
> fix. Anybody?

As I just learned from David, gtk uses an event-loop, so the callback
triggered by setting the radio-button to zero, will be executed
_after_ the current function is completely finished and control is
passed back to gtk.

'coz if an event would trigger a new function _before_ finishing its
current function, you would immediately have multiple threads when the
_user_ creates a new event.

And now, David, I have to tell Mike what would happen if his were
the case: There are >1 threads of control _and_you_will_never_know_
_the_order_of_execution_ hence random crashes on your -1 index. That's
worse than a 100% guarantee of a crash.

Bye,
Kero.

+--- Kero --------------------------------- kero@xxxxxx ---+
|  Don't split your mentality without thinking twice       |
|                          Proud like a God -- Guano Apes  |
+--- M38c ------------------ http://huizen.dds.nl/~kero ---+



[Prev in Thread] Current Thread [Next in Thread]