internal bugfix: object pointer was only reset to NULL when an object was actually destructed.

This most likely had no effect to existing code, but it may also have
caused trouble in remote cases. Similarly, the fix may also cause trouble...
Due to this trouble scenario, the fix deserves its own commit.
This commit is contained in:
Rainer Gerhards 2009-06-30 18:54:49 +02:00
parent 8515376ac9
commit a0496e7bd4
2 changed files with 16 additions and 1 deletions

View File

@ -1,4 +1,10 @@
---------------------------------------------------------------------------
Version 4.3.3 [beta] (rgerhards), 2009-0?-??
- internal bugfix: object pointer was only reset to NULL when an object
was actually destructed. This most likely had no effect to existing code,
but it may also have caused trouble in remote cases. Similarly, the fix
may also cause trouble...
---------------------------------------------------------------------------
Version 4.3.2 [beta] (rgerhards), 2009-06-24
- removed long-obsoleted property UxTradMsg
- added a generic network stream server (in addition to rather specific

View File

@ -292,6 +292,15 @@ rsRetVal objName##ClassExit(void) \
ISOBJ_TYPE_assert(pThis, OBJ); \
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &iCancelStateSave);
/* note: there was a long-time bug in the macro below that lead to *ppThis = NULL
* only when the object was actually destructed. I discovered this issue during
* introduction of the pRcvFrom property in msg_t, but it potentially had other
* effects, too. I am not sure if some experienced instability resulted from this
* bug OR if its fix will cause harm to so-far "correctly" running code. The later
* may very well be. Thus I will change it only for the current branch and also
* the beta, but not in all old builds. Let's see how things evolve.
* rgerhards, 2009-06-30
*/
#define ENDobjDestruct(OBJ) \
goto finalize_it; /* prevent compiler warning ;) */ \
/* no more code here! */ \
@ -299,8 +308,8 @@ rsRetVal objName##ClassExit(void) \
if(pThis != NULL) { \
obj.DestructObjSelf((obj_t*) pThis); \
free(pThis); \
*ppThis = NULL; \
} \
*ppThis = NULL; \
pthread_setcancelstate(iCancelStateSave, NULL); \
RETiRet; \
}