Close service only after config mutex unlocked on reload

This commit is contained in:
Vladimir Dubrovin 2022-08-12 19:18:52 +03:00
parent c98621aeef
commit bac19c9ae6

View File

@ -876,9 +876,6 @@ int MODULEMAINFUNC (int argc, char** argv){
if(isudp) while(!srv.fds.events)usleep(SLEEPTIME);
}
if(!srv.silent) srv.logfunc(&defparam, (unsigned char *)"Exiting thread");
srvfree(&srv);
#ifndef STDMAIN
pthread_mutex_lock(&config_mutex);
@ -888,6 +885,9 @@ int MODULEMAINFUNC (int argc, char** argv){
pthread_mutex_unlock(&config_mutex);
#endif
if(!srv.silent) srv.logfunc(&defparam, (unsigned char *)"Exiting thread");
srvfree(&srv);
#ifndef _WIN32
pthread_attr_destroy(&pa);
#endif