Fix debug assertion on shutdown

The debug assertion that asserts that services are destroyed only on the
main worker would be triggered on shutdown as there is no current worker
at that point in time. In addition to this, it is wrong to call
service_destroy at shutdown as that will remove persisted
configurations. The service_free function can be called directly as we
know no other thread are running when the services are being torn down.

Also added the missing check that the destroyInstance function is
implemented before calling it.
This commit is contained in:
Markus Mäkelä
2018-07-30 02:10:42 +03:00
parent cc2ae7a0cb
commit ad5762a2fb
4 changed files with 28 additions and 10 deletions

View File

@ -50,3 +50,15 @@ int maxscale_shutdown()
return n + 1;
}
static bool teardown_in_progress = false;
bool maxscale_teardown_in_progress()
{
return teardown_in_progress;
}
void maxscale_start_teardown()
{
teardown_in_progress = true;
}