Hi Angus,

Angus Leeming wrote:

> Ooohhhh, that's devious. In that case I think we really need a two pass
> algorithm:
> 
>         ListType::iterator it  = forkedCalls.begin();
>         ListType::iterator end = forkedCalls.end();
>         for (; it != end; ++it) {
>                 bool remove_it = ...;
> 
>                 if (remove_it) {
>                         // Emit signal.
>                         // Do not remove the item from the list yet.
>                         (*it)->emitSignal();
>                         delete *it;
                                  ^^ this it is possibly invalid (the list
may be void at this point).

The problem is not the erase in timer(), but the erase in kill().

If want to do it this way, I think you will have to modify the kill()
method, making not to erase elements of the list, but to put them to zero.

Or... why you don't like my way? Efficiency? 

Regards, 
        Alfredo


Reply via email to