TINSEL: Memory Leak Fix in Coroutines.

This fixes the leak from the COR0_BEGIN_CODE macro's CoroContextTag allocation.
Setting the _sleep value to negative values prevented the deallocation of these.
Have tested for obvious regressions, but a full DW/DW2 playtest should be done to confirm that this doesn't cause any issues.
Thanks to fingolfin for indicating this solution.

svn-id: r55671
This commit is contained in:
David Turner 2011-01-30 23:21:40 +00:00
parent 785f1776c4
commit 9573b1d2f5

View File

@ -184,7 +184,7 @@ public:
* Stop the currently running coroutine.
*/
#define CORO_KILL_SELF() \
do { if (&coroParam != &nullContext) { coroParam->_sleep = -1; } return; } while (0)
do { if (&coroParam != &nullContext) { coroParam->_sleep = 0; } return; } while (0)
/**