X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlib%2Fmc.h;h=28f94350537cdd57bc9f4156849d93027eae20f5;hb=904a850899db0a40bf885d2ee2e839a5f8dfbeb3;hp=dc95b0e90747e811087d7992e103e64eaf45eb7a;hpb=7cd468a3d7dee7d6c92f69a0bb7061ae208ec727;p=vpp.git diff --git a/src/vlib/mc.h b/src/vlib/mc.h index dc95b0e9074..28f94350537 100644 --- a/src/vlib/mc.h +++ b/src/vlib/mc.h @@ -261,6 +261,14 @@ static void __mc_serialize_msg_registration_##x (void) \ x.next_registration = vm->mc_msg_registrations; \ vm->mc_msg_registrations = &x; \ } \ +static void __mc_serialize_msg_unregistration_##x (void) \ + __attribute__((__destructor__)) ; \ +static void __mc_serialize_msg_unregistration_##x (void) \ +{ \ + vlib_main_t * vm = vlib_get_main(); \ + VLIB_REMOVE_FROM_LINKED_LIST (vm->mc_msg_registrations, &x, \ + next_registration); \ +} \ __VA_ARGS__ mc_serialize_msg_t x typedef enum