Astobj2: Fix initialization order of refdebug and AO2_DEBUG.
authorCorey Farrell <git@cfware.com>
Fri, 1 May 2015 18:22:03 +0000 (14:22 -0400)
committerCorey Farrell <git@cfware.com>
Fri, 1 May 2015 18:40:50 +0000 (14:40 -0400)
commit8f3cee125816486875c7d7d12dcf02dbf2b642d1
treeb6ab63bf0b67c363e6e1435e69ebabaa2b97c153
parent01f3d5b7d4821e9c7fc21982814eb2c137f1d8d9
Astobj2: Fix initialization order of refdebug and AO2_DEBUG.

This ensures that refdebug is initialized before AO2_DEBUG if
both are enabled, since AO2_DEBUG allocates a container.

This change also makes AO2_DEBUG initialization critical, a
failure will abort Asterisk startup.  This is needed since
the failure would be caused by reg_containers allocation
failure, and that would result in a segmentation fault by
ao2_container_register later in startup.

ASTERISK-25048 #close
Reported by: Corey Farrell

Change-Id: I9a243ea3fc5653b48b931ba6d61971cb2e530244
main/asterisk.c
main/astobj2.c