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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user