Menu

#8 event_caller_block_t is destroyed even if there is a demand for it

2014_01
closed-fixed
nobody
None
5
2014-07-04
2013-12-31
No

In this simple situation:

void
so_evt_start()
{
    m_mbox->deliver_signal< msg_one >();
    m_mbox->deliver_signal< msg_two >();
}
void
evt_one( const so_5::rt::event_data_t< msg_one > & )
{
    so_drop_subscription( m_mbox, &a_test_t::evt_two );
}
void
evt_two( const so_5::rt::event_data_t< msg_two > & )
{
    ACE_OS::abort();
}

event_caller_block_t for msg_two is destroyed when there is a demand for it in event queue.

Discussion

  • Nicolai Grodzitski

    It even can call smth. different due to memory changes that might happen before event_caller_block_t is called (what if a subscription on some other event goes right after so_drop_subscription), but ghost object defined logic or crach are more likely.

    Seems like smart pointer wrapper should be returned, and may be kind of event_caller_block-workability-flag added to handle only events that are active at the moment.

     
    • Yauheni Akhotnikau

      The problem is solved in 5.2.3.3 (fixed as tag). The source is refactoring in 5.2.3 where unsubscription was removed and then reintroduced in 5.2.3.2. In previous versions reference to event_caller_block was stored in event_info by smart pointer. Then in 5.2.3 it was changed to storing raw pointers. Now it is returned back to smart pointers.

      The bug is not closed to check the correctness in future version 5.2.4 later.

       
  • Yauheni Akhotnikau

    • status: open --> closed-fixed
     

Log in to post a comment.