[asterisk-commits] dlee: branch dlee/shutdown-deux r389547 - in /team/dlee/shutdown-deux: includ...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu May 23 09:32:56 CDT 2013
Author: dlee
Date: Thu May 23 09:32:53 2013
New Revision: 389547
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=389547
Log:
Put the assert-to-error patch back in
Modified:
team/dlee/shutdown-deux/include/asterisk/stasis.h
team/dlee/shutdown-deux/main/stasis.c
Modified: team/dlee/shutdown-deux/include/asterisk/stasis.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/shutdown-deux/include/asterisk/stasis.h?view=diff&rev=389547&r1=389546&r2=389547
==============================================================================
--- team/dlee/shutdown-deux/include/asterisk/stasis.h (original)
+++ team/dlee/shutdown-deux/include/asterisk/stasis.h Thu May 23 09:32:53 2013
@@ -633,6 +633,12 @@
/*! @{ */
/*!
+ * \internal
+ * \brief Log a message about invalid attempt to access a type.
+ */
+void stasis_log_bad_type_access(const char *name);
+
+/*!
* \brief Boiler-plate removing macro for defining message types.
*
* \param name Name of message type.
@@ -641,7 +647,9 @@
#define STASIS_MESSAGE_TYPE_DEFN(name) \
static struct stasis_message_type *_priv_ ## name; \
struct stasis_message_type *name(void) { \
- ast_assert(_priv_ ## name != NULL); \
+ if (_priv_ ## name == NULL) { \
+ stasis_log_bad_type_access(#name); \
+ } \
return _priv_ ## name; \
}
Modified: team/dlee/shutdown-deux/main/stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/shutdown-deux/main/stasis.c?view=diff&rev=389547&r1=389546&r2=389547
==============================================================================
--- team/dlee/shutdown-deux/main/stasis.c (original)
+++ team/dlee/shutdown-deux/main/stasis.c Thu May 23 09:32:53 2013
@@ -619,6 +619,11 @@
return topic_pool_entry->topic;
}
+void stasis_log_bad_type_access(const char *name)
+{
+ ast_log(LOG_ERROR, "Use of %s() before init/after destruction\n", name);
+}
+
/*! \brief Cleanup function */
static void stasis_exit(void)
{
More information about the asterisk-commits
mailing list