1 | /********************************************************************** |
2 | * _logFreeMsg |
3 | * |
4 | * This code was created by Peter Harvey (mostly during Christmas 98/99). |
5 | * This code is LGPL. Please ensure that this message remains in future |
6 | * distributions and uses of this code (thats about all I get out of it). |
7 | * - Peter Harvey pharvey@codebydesign.com |
8 | * |
9 | **********************************************************************/ |
10 | |
11 | #include <config.h> |
12 | #include "log.h" |
13 | |
14 | /*! |
15 | * \brief Callback function to free mem used by a message. |
16 | * |
17 | * This function is set in logOpen and is automatically used |
18 | * to free mem used by a message when the message is deleted. |
19 | * |
20 | * \param pMsg |
21 | * |
22 | * \sa logOpen |
23 | */ |
24 | void _logFreeMsg( void *pMsg ) |
25 | { |
26 | HLOGMSG hMsg = (HLOGMSG)pMsg; |
27 | |
28 | if ( !hMsg ) return; |
29 | |
30 | /* free msg memory */ |
31 | if ( hMsg->pszModuleName != NULL ) free(hMsg->pszModuleName); |
32 | if ( hMsg->pszFunctionName != NULL ) free(hMsg->pszFunctionName); |
33 | if ( hMsg->pszMessage != NULL ) free(hMsg->pszMessage); |
34 | |
35 | free( hMsg ); |
36 | } |
37 | |
38 | |
39 | |