Merged revisions 143609 via svnmerge from

https://origsvn.digium.com/svn/asterisk/trunk

........
r143609 | mmichelson | 2008-09-19 10:43:28 -0500 (Fri, 19 Sep 2008) | 11 lines

We should only unsubscribe to the device state event
subscription if we have previously subscribed. Otherwise
a segfault will occur.

(closes issue #13476)
Reported by: jonnt
Patches:
      13476.patch uploaded by putnopvut (license 60)
Tested by: jonnt


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@143610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2008-09-19 15:48:37 +00:00
parent 9f74603219
commit f6376d0130

View File

@@ -2492,7 +2492,9 @@ static int unload_module(void)
/* First, take us out of the channel loop */
ast_channel_unregister(&agent_tech);
/* Delete devicestate subscription */
ast_event_unsubscribe(agent_devicestate_sub);
if (agent_devicestate_sub) {
agent_devicestate_sub = ast_event_unsubscribe(agent_devicestate_sub);
}
/* Unregister dialplan functions */
ast_custom_function_unregister(&agent_function);
/* Unregister CLI commands */