summaryrefslogtreecommitdiffstats
path: root/wtp.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-30 08:02:42 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-30 08:02:42 +0000
commit4984c1ba6c84a3ae91f9afd4da2ea718c98c97a7 (patch)
tree39972db40d9d0f642879a663aadcad996a510e50 /wtp.c
parentef44f5c9ba319e2813e5ea23b2699b73b63cdcbb (diff)
downloadrsyslog-4984c1ba6c84a3ae91f9afd4da2ea718c98c97a7.tar.gz
rsyslog-4984c1ba6c84a3ae91f9afd4da2ea718c98c97a7.tar.xz
rsyslog-4984c1ba6c84a3ae91f9afd4da2ea718c98c97a7.zip
- renamed Msg object to usual all-lowercase object name (else we ran into
troubles with the framework, also it was somewhat ugly...) - fixed a memory leak in object destruction (was recently introduced by object naming, not present in any released version)
Diffstat (limited to 'wtp.c')
-rw-r--r--wtp.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/wtp.c b/wtp.c
index 69ca353b..7b34076a 100644
--- a/wtp.c
+++ b/wtp.c
@@ -125,21 +125,9 @@ finalize_it:
/* Destructor */
-rsRetVal
-wtpDestruct(wtp_t **ppThis)
-{
- DEFiRet;
- wtp_t *pThis;
- int iCancelStateSave;
+BEGINobjDestruct(wtp) /* be sure to specify the object type also in END and CODESTART macros! */
int i;
-
- assert(ppThis != NULL);
- pThis = *ppThis;
- ISOBJ_TYPE_assert(pThis, wtp);
-
- /* we can not be canceled, that would have a myriad of side-effects */
- pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave);
-
+CODESTARTobjDestruct(wtp)
/* destruct workers */
for(i = 0 ; i < pThis->iNumWorkerThreads ; ++i)
wtiDestruct(&pThis->pWrkr[i]);
@@ -153,16 +141,7 @@ wtpDestruct(wtp_t **ppThis)
if(pThis->pszDbgHdr != NULL)
free(pThis->pszDbgHdr);
-
- /* and finally delete the queue objet itself */
- free(pThis);
- *ppThis = NULL;
-
- /* back to normal */
- pthread_setcancelstate(iCancelStateSave, NULL);
-
- RETiRet;
-}
+ENDobjDestruct(wtp)
/* wake up at least one worker thread.