Hi,
LE adv manager is supposed to clear advertisements when the DBus client, which did the registration, is disconnected. However, client_disconnect_cb() from advertising.c is not called if DBus client calls RegisterAdvertisement DBus method and then immediately exits (like exit(0)). Next time, the client gets "Maximum advertisements reached" error and is unable to register advertisements until bluetooth daemon is restarted. Obviously, it shouldn't matter for BlueZ daemon whether client terminates gracefully or not. It might be related to some mistake in refcount handling of DBusClient in advertisement code, but I'm not really sure.
Bluez 5.32 + Linux 4.1.2 used.
BR, Andrey