diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-30 08:02:42 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-30 08:02:42 +0000 |
commit | 4984c1ba6c84a3ae91f9afd4da2ea718c98c97a7 (patch) | |
tree | 39972db40d9d0f642879a663aadcad996a510e50 /wti.c | |
parent | ef44f5c9ba319e2813e5ea23b2699b73b63cdcbb (diff) | |
download | rsyslog-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 'wti.c')
-rw-r--r-- | wti.c | 26 |
1 files changed, 3 insertions, 23 deletions
@@ -144,19 +144,8 @@ wtiSetState(wti_t *pThis, qWrkCmd_t tCmd, int bActiveOnly, int bLockMutex) /* Destructor */ -rsRetVal wtiDestruct(wti_t **ppThis) -{ - DEFiRet; - wti_t *pThis; - int iCancelStateSave; - - assert(ppThis != NULL); - pThis = *ppThis; - ISOBJ_TYPE_assert(pThis, wti); - - /* we can not be canceled, that would have a myriad of side-effects */ - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave); - +BEGINobjDestruct(wti) /* be sure to specify the object type also in END and CODESTART macros! */ +CODESTARTobjDestruct(wti) /* if we reach this point, we must make sure the associated worker has terminated. It is * the callers duty to make sure the worker already knows it shall terminate. * TODO: is it *really* the caller's duty? ...mmmhhhh.... smells bad... rgerhards, 2008-01-25 @@ -180,16 +169,7 @@ rsRetVal wtiDestruct(wti_t **ppThis) if(pThis->pszDbgHdr != NULL) free(pThis->pszDbgHdr); - - /* and finally delete the wti object itself */ - free(pThis); - *ppThis = NULL; - - /* back to normal */ - pthread_setcancelstate(iCancelStateSave, NULL); - - RETiRet; -} +ENDobjDestruct(wti) /* Standard-Constructor for the wti object |