Re: [sigc] freeze signal when emitting

I was trying to do exactly that same thing. I accomplished the "A won't
call C" part by using a marshaller to stop the signal (in my case I only
wanted 1 slot to run). I have some sample test code if you'd like to see

I ended up abandoning the approach because, though the test worked, when
I implemented it in code I got intermittent segfaults and dropping of
signals. Best I could figure was that they were caused because I was
destructing the slot's class within a function called by the slot. 

I instead used a single slot connected to the signal who figured out
which function to call. 


On Thu, 2004-01-08 at 03:30, Ulrich Eckhardt wrote:
> pclouds wrote:
> > I'm using libsigc++ 1.2. I have a problem with signal/slot. I have a
> > signal A which connect to slot B. Slot B, when called, will connect or
> > disconnect other slots to signal A.
> So far, so good, that should be supported.
> > When i emit signal A, it call slot B, which connect new slot (C) to
> > signal A. Then the emittion procedure call slot C after B finish. But
> > i don't want that. I want to be able to add slot C to A but A won't
> > call C until the next emission. Can i do that with libsigc++ 1.2?
> No. There is no API to specify where to add a slot (in 1.2 that is, I'm not 
> sure about the upcoming 2).
> > Disconnecting a slot from a signal when emitting also causes problems.
> Huh? What is "problems"? In case you suspect a real bug, please make a minimal 
> example and describe what it does and what you expected.
> Uli
> _______________________________________________
> libsigc-list mailing list
> libsigc-list gnome org
Peter Gasper <pgasper designadvantage com>

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