summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-11-09 02:56:29 +0000
committerBenny Prijono <bennylp@teluu.com>2007-11-09 02:56:29 +0000
commitad6553605cd238db1cab766bcc1650d9731dc766 (patch)
treee71cbfe9e2ea780873ea3de9924539ed3d5877e3
parentb78c660663ac364b2130bd136371fc53c06fdc6e (diff)
Deregister PJSIP_SYN_ERR_EXCEPTION upon destroying SIP endpoint to allow restarting SIP endpoint without shutting down pjlib (thanks Phil Torre)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1566 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--pjsip/src/pjsip/sip_parser.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/pjsip/src/pjsip/sip_parser.c b/pjsip/src/pjsip/sip_parser.c
index d63b3887..bb77dcca 100644
--- a/pjsip/src/pjsip/sip_parser.c
+++ b/pjsip/src/pjsip/sip_parser.c
@@ -85,7 +85,7 @@ static unsigned uri_handler_count;
/*
* Global vars (also extern).
*/
-int PJSIP_SYN_ERR_EXCEPTION;
+int PJSIP_SYN_ERR_EXCEPTION = -1;
/* Parser constants */
static pjsip_parser_const_t pconst =
@@ -276,6 +276,7 @@ static pj_status_t init_parser()
/*
* Syntax error exception number.
*/
+ pj_assert (PJSIP_SYN_ERR_EXCEPTION == -1);
status = pj_exception_id_alloc("PJSIP syntax error",
&PJSIP_SYN_ERR_EXCEPTION);
PJ_ASSERT_RETURN(status == PJ_SUCCESS, status);
@@ -482,6 +483,10 @@ void deinit_sip_parser(void)
/* Clear URI handlers */
pj_bzero(uri_handler, sizeof(uri_handler));
uri_handler_count = 0;
+
+ /* Deregister exception ID */
+ pj_exception_id_free(PJSIP_SYN_ERR_EXCEPTION);
+ PJSIP_SYN_ERR_EXCEPTION = -1;
}
pj_leave_critical_section();
}