Correct test_cel cleanup.
When I corrected the CEL test crash in r394037, I didn't quite pay attention to how the globals and locals were being shuffled around in the cleanup callback. I removed the nulling of the global variables, which caused them to be double cleaned. This patch puts the global nulling code back (since the vars are cleaned up by RAII_VARs), and removes the explicit ao2_cleanup() (since they were no-ops, because the variables had just been nulled). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
parent
684481b74c
commit
c2bb638f1f
|
@ -1335,6 +1335,10 @@ static int cel_verify_and_cleanup_cb(struct ast_test_info *info, struct ast_test
|
||||||
ast_event_unsubscribe(event_sub);
|
ast_event_unsubscribe(event_sub);
|
||||||
event_sub = NULL;
|
event_sub = NULL;
|
||||||
|
|
||||||
|
/* cleaned up by RAII_VAR's */
|
||||||
|
cel_expected_events = NULL;
|
||||||
|
cel_received_events = NULL;
|
||||||
|
|
||||||
/* check events */
|
/* check events */
|
||||||
ast_test_validate(test, !check_events(local_expected, local_received));
|
ast_test_validate(test, !check_events(local_expected, local_received));
|
||||||
|
|
||||||
|
@ -1343,11 +1347,7 @@ static int cel_verify_and_cleanup_cb(struct ast_test_info *info, struct ast_test
|
||||||
ao2_cleanup(saved_config);
|
ao2_cleanup(saved_config);
|
||||||
saved_config = NULL;
|
saved_config = NULL;
|
||||||
|
|
||||||
/* get rid of events */
|
/* clean up the locks */
|
||||||
ao2_cleanup(cel_received_events);
|
|
||||||
cel_received_events = NULL;
|
|
||||||
ao2_cleanup(cel_expected_events);
|
|
||||||
cel_expected_events = NULL;
|
|
||||||
ast_mutex_destroy(&sync_lock);
|
ast_mutex_destroy(&sync_lock);
|
||||||
ast_cond_destroy(&sync_out);
|
ast_cond_destroy(&sync_out);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue