File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -263,7 +263,11 @@ int MessageBus::deleteMarkedListeners()
263263 Listener *t = l;
264264 l = l->next ;
265265
266- delete t;
266+ // If notification of deletion has been requested, invoke the listener deletion callback.
267+ if (listener_deletion_callback)
268+ listener_deletion_callback (t);
269+
270+ delete t;
267271 removed++;
268272
269273 continue ;
@@ -520,10 +524,6 @@ int MessageBus::remove(Listener *listener)
520524 {
521525 if ((listener->id == DEVICE_ID_ANY || listener->id == l->id ) && (listener->value == DEVICE_EVT_ANY || listener->value == l->value ))
522526 {
523- // If notification of deletion has been requested, invoke the listener deletion callback.
524- if (listener_deletion_callback)
525- listener_deletion_callback (l);
526-
527527 // Found a match. mark this to be removed from the list.
528528 l->flags |= MESSAGE_BUS_LISTENER_DELETING;
529529 removed++;
You can’t perform that action at this time.
0 commit comments