File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3535EventPublisher::drop_publisher (event_handle_t handle)
3636{
3737 lst_publishers_t ::iterator it;
38+ EventPublisher_ptr_t p;
3839
3940 for (it=s_publishers.begin (); it != s_publishers.end (); ++it) {
4041 if (it->second .get () == handle) {
42+ p = it->second ;
4143 s_publishers.erase (it);
4244 break ;
4345 }
4446 }
47+
48+ if (p != NULL ) {
49+ p->remove_runtime_id ();
50+ }
4551}
4652
4753int
@@ -114,17 +120,21 @@ int EventPublisher::init(const string event_source)
114120
115121EventPublisher::~EventPublisher ()
116122{
117- if (!m_runtime_id.empty ()) {
118- /* Retire the runtime ID */
119- send_evt (EVENT_STR_CTRL_DEINIT);
120- }
121123 m_event_service.close_service ();
122124 if (m_socket != NULL ) {
123125 zmq_close (m_socket);
124126 }
125127 zmq_ctx_term (m_zmq_ctx);
126128}
127129
130+ void
131+ EventPublisher::remove_runtime_id ()
132+ {
133+ if (!m_runtime_id.empty ()) {
134+ /* Retire the runtime ID */
135+ send_evt (EVENT_STR_CTRL_DEINIT);
136+ }
137+ }
128138
129139int
130140EventPublisher::send_evt (const string str_data)
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ class EventPublisher : public events_base
6161 int publish (const string event_tag,
6262 const event_params_t *params);
6363 int send_evt (const string str_data);
64+ void remove_runtime_id ();
6465
6566 void *m_zmq_ctx;
6667 void *m_socket;
You can’t perform that action at this time.
0 commit comments