summaryrefslogtreecommitdiff
path: root/pjlib
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-12-01 11:14:37 +0000
committerBenny Prijono <bennylp@teluu.com>2006-12-01 11:14:37 +0000
commitb9032ff0ae71378939fda1bacde4ee89a685f6d1 (patch)
treea0e337be547e0d1b5760c2a226535f9e6f1f550c /pjlib
parent634423cd1e3f12d6cc70c8e6564d40e986eb0312 (diff)
Fixed ticket #29: calling pjsua_init() to reinitialize the whole libraries after pjsua_destroy() is called
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@839 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib')
-rw-r--r--pjlib/include/pj/errno.h3
-rw-r--r--pjlib/src/pj/config.c2
-rw-r--r--pjlib/src/pj/errno.c8
-rw-r--r--pjlib/src/pj/except.c10
-rw-r--r--pjlib/src/pj/os_core_unix.c3
-rw-r--r--pjlib/src/pj/os_core_win32.c3
-rw-r--r--pjlib/src/pj/pool_buf.c2
7 files changed, 30 insertions, 1 deletions
diff --git a/pjlib/include/pj/errno.h b/pjlib/include/pj/errno.h
index 03440c2a..7ca36e98 100644
--- a/pjlib/include/pj/errno.h
+++ b/pjlib/include/pj/errno.h
@@ -346,5 +346,8 @@ PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start_code,
PJ_END_DECL
+/* Internal */
+void pj_errno_clear_handlers(void);
+
#endif /* __PJ_ERRNO_H__ */
diff --git a/pjlib/src/pj/config.c b/pjlib/src/pj/config.c
index cce57304..e4c5db61 100644
--- a/pjlib/src/pj/config.c
+++ b/pjlib/src/pj/config.c
@@ -21,7 +21,7 @@
#include <pj/ioqueue.h>
static const char *id = "config.c";
-const char *PJ_VERSION = "0.5.9";
+const char *PJ_VERSION = "0.5.9.1";
PJ_DEF(void) pj_dump_config(void)
{
diff --git a/pjlib/src/pj/errno.c b/pjlib/src/pj/errno.c
index 1d7767f4..cbbe0684 100644
--- a/pjlib/src/pj/errno.c
+++ b/pjlib/src/pj/errno.c
@@ -133,6 +133,14 @@ PJ_DECL(pj_status_t) pj_register_strerror(pj_status_t start,
return PJ_SUCCESS;
}
+/* Internal PJLIB function called by pj_shutdown() to clear error handlers */
+void pj_errno_clear_handlers(void)
+{
+ err_msg_hnd_cnt = 0;
+ pj_bzero(err_msg_hnd, sizeof(err_msg_hnd));
+}
+
+
/*
* pj_strerror()
*/
diff --git a/pjlib/src/pj/except.c b/pjlib/src/pj/except.c
index bb21e05b..4bbd410b 100644
--- a/pjlib/src/pj/except.c
+++ b/pjlib/src/pj/except.c
@@ -57,6 +57,16 @@ static void exception_cleanup(void)
pj_thread_local_free(thread_local_id);
thread_local_id = -1;
}
+
+#if defined(PJ_HAS_EXCEPTION_NAMES) && PJ_HAS_EXCEPTION_NAMES != 0
+ {
+ unsigned i;
+ for (i=0; i<PJ_MAX_EXCEPTION_ID; ++i)
+ exception_id_names[i] = NULL;
+ }
+#else
+ last_exception_id = 1;
+#endif
}
PJ_DEF(void) pj_push_exception_handler_(struct pj_exception_state_t *rec)
diff --git a/pjlib/src/pj/os_core_unix.c b/pjlib/src/pj/os_core_unix.c
index 2d69d6d0..9fd8d372 100644
--- a/pjlib/src/pj/os_core_unix.c
+++ b/pjlib/src/pj/os_core_unix.c
@@ -207,6 +207,9 @@ PJ_DEF(void) pj_shutdown()
thread_tls_id = -1;
}
#endif
+
+ /* Clear static variables */
+ pj_errno_clear_handlers();
}
diff --git a/pjlib/src/pj/os_core_win32.c b/pjlib/src/pj/os_core_win32.c
index 23e2cde1..788d71f5 100644
--- a/pjlib/src/pj/os_core_win32.c
+++ b/pjlib/src/pj/os_core_win32.c
@@ -218,6 +218,9 @@ PJ_DEF(void) pj_shutdown()
thread_tls_id = -1;
}
+ /* Clear static variables */
+ pj_errno_clear_handlers();
+
/* Shutdown Winsock */
//WSACleanup();
}
diff --git a/pjlib/src/pj/pool_buf.c b/pjlib/src/pj/pool_buf.c
index 44115f3a..c373fa75 100644
--- a/pjlib/src/pj/pool_buf.c
+++ b/pjlib/src/pj/pool_buf.c
@@ -38,6 +38,8 @@ static void pool_buf_cleanup(void)
pj_thread_local_free(tls);
tls = -1;
}
+ if (is_initialized)
+ is_initialized = 0;
}
static pj_status_t pool_buf_initialize()