]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fixed intermittent crash when loading test_json.so
authorDavid M. Lee <dlee@digium.com>
Fri, 12 Jul 2013 18:23:39 +0000 (18:23 +0000)
committerDavid M. Lee <dlee@digium.com>
Fri, 12 Jul 2013 18:23:39 +0000 (18:23 +0000)
commitc3ffc13e41fa953b0a2f23efb4d8ec7485a36bf9
tree58b2a4c5addfc9b31340625705cd3a853e9d4b18
parent2bad69006f8ea6bec50c94e8e1ec90a6684ef9ab
Fixed intermittent crash when loading test_json.so

The JSON test attempted an overly clever use of RAII_VAR to run code
at the beginning and end of each test, in order to validate that no
JSON objects were leaked during the test.

The problem is that the validation code would run during the initial
load, when the tests were initialized. This happens during startup,
when other parts of the system might actively be allocating and
freeing JSON objects.

This patch changes the RAII_VAR to use the new
ast_test_register_{init,cleanup} functions to run the validations
properly.

(closes issue ASTERISK-21978)
Review: https://reviewboard.asterisk.org/r/2669/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@394203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
tests/test_json.c