mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-24 14:56:58 +00:00
Final fix memleaks in GkClient codes, same for Timer codes.
(these memleaks stop development of gk codes, now i can continue) Fix printHandler 'Unbalanced Structure' issues with locking printHandler data for single thread. ........ Merged revisions 343281 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 343445 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@343448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include "ootrace.h"
|
||||
|
||||
EventHandler printHandler;
|
||||
AST_MUTEX_DEFINE_STATIC(printlock);
|
||||
|
||||
static const char* pVarName;
|
||||
static int gIndentSpaces;
|
||||
@@ -60,6 +61,7 @@ void initializePrintHandler(EventHandler *printHandler, char * varname)
|
||||
printHandler->enumValue = &printEnumValue;
|
||||
printHandler->openTypeValue = &printOpenTypeValue;
|
||||
pVarName = varname;
|
||||
ast_mutex_lock(&printlock);
|
||||
OOTRACEDBGB2("%s = {\n", pVarName);
|
||||
gIndentSpaces += 3;
|
||||
|
||||
@@ -72,6 +74,8 @@ void finishPrint()
|
||||
if (gIndentSpaces != 0) {
|
||||
OOTRACEDBGB1 ("ERROR: unbalanced structure\n");
|
||||
}
|
||||
gIndentSpaces = 0;
|
||||
ast_mutex_unlock(&printlock);
|
||||
}
|
||||
|
||||
void indent ()
|
||||
|
Reference in New Issue
Block a user