aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_agent.c
diff options
context:
space:
mode:
Diffstat (limited to 'channels/chan_agent.c')
-rw-r--r--channels/chan_agent.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/channels/chan_agent.c b/channels/chan_agent.c
index f0d913ff3..f582b7287 100644
--- a/channels/chan_agent.c
+++ b/channels/chan_agent.c
@@ -2492,10 +2492,7 @@ static int unload_module(void)
/* First, take us out of the channel loop */
ast_channel_unregister(&agent_tech);
/* Delete devicestate subscription */
- if (agent_devicestate_sub) {
- ast_event_unsubscribe(agent_devicestate_sub);
- agent_devicestate_sub = NULL;
- }
+ ast_event_unsubscribe(agent_devicestate_sub);
/* Unregister dialplan functions */
ast_custom_function_unregister(&agent_function);
/* Unregister CLI commands */