提交 0fd7cd7b authored 作者: Anthony Minessale's avatar Anthony Minessale

reinit properly

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@510 a93c3328-9c30-0410-af19-c9cd2b2d52af
上级 465329ea
...@@ -2102,6 +2102,8 @@ zap_status_t zap_global_init(void) ...@@ -2102,6 +2102,8 @@ zap_status_t zap_global_init(void)
{ {
int modcount; int modcount;
memset(&globals, 0, sizeof(globals));
time_init(); time_init();
zap_isdn_init(); zap_isdn_init();
zap_ss7_boost_init(); zap_ss7_boost_init();
...@@ -2224,6 +2226,8 @@ zap_status_t zap_global_destroy(void) ...@@ -2224,6 +2226,8 @@ zap_status_t zap_global_destroy(void)
hashtable_destroy(globals.interface_hash, 0, 0); hashtable_destroy(globals.interface_hash, 0, 0);
zap_mutex_unlock(globals.mutex); zap_mutex_unlock(globals.mutex);
zap_mutex_destroy(&globals.mutex); zap_mutex_destroy(&globals.mutex);
memset(&globals, 0, sizeof(globals));
return ZAP_SUCCESS; return ZAP_SUCCESS;
} }
......
...@@ -1330,6 +1330,8 @@ zap_status_t pika_destroy(void) ...@@ -1330,6 +1330,8 @@ zap_status_t pika_destroy(void)
if ((status = PKH_SYSTEM_Close(globals.system_handle)) != PK_SUCCESS) { if ((status = PKH_SYSTEM_Close(globals.system_handle)) != PK_SUCCESS) {
zap_log(ZAP_LOG_ERROR, "Error: PKH_SYSTEM_Close failed(%s)!\n", zap_log(ZAP_LOG_ERROR, "Error: PKH_SYSTEM_Close failed(%s)!\n",
PKH_ERROR_GetText(status, error_text, sizeof(error_text))); PKH_ERROR_GetText(status, error_text, sizeof(error_text)));
} else {
zap_log(ZAP_LOG_INFO, "Closing system handle\n");
} }
hashtable_destroy(globals.profile_hash, 0, 1); hashtable_destroy(globals.profile_hash, 0, 1);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论