add another logInit so that early messages go to zms.log after loading config. Add Image::Initialise so that initialised flag will get set, and add a Deinitialise call so that ram allocated in zm_image gets freed.

This commit is contained in:
Isaac Connor 2021-05-01 14:49:24 -04:00
parent 59b1927ad6
commit 88147f3f7a
1 changed files with 3 additions and 0 deletions

View File

@ -87,6 +87,7 @@ int main(int argc, const char *argv[], char **envp) {
zmLoadStaticConfig(); zmLoadStaticConfig();
zmDbConnect(); zmDbConnect();
zmLoadDBConfig(); zmLoadDBConfig();
logInit(log_id_string);
for (char **env = envp; *env != 0; env++) { for (char **env = envp; *env != 0; env++) {
char *thisEnv = *env; char *thisEnv = *env;
@ -230,6 +231,7 @@ int main(int argc, const char *argv[], char **envp) {
} // end if config.opt_use_auth } // end if config.opt_use_auth
HwCapsDetect(); HwCapsDetect();
Image::Initialise();
zmSetDefaultTermHandler(); zmSetDefaultTermHandler();
zmSetDefaultDieHandler(); zmSetDefaultDieHandler();
@ -338,6 +340,7 @@ int main(int argc, const char *argv[], char **envp) {
} // end if monitor or event } // end if monitor or event
Debug(1, "Terminating"); Debug(1, "Terminating");
Image::Deinitialise();
logTerm(); logTerm();
zmDbClose(); zmDbClose();