- A logic error when setting up new GC roots and tearing down old ones in
GrowCallbackList()
(in OOJSFrameCallbacks.m, natch). - A problem with GC roots made in one JS context/compartment pair being kept around when a new context/compartment are set up on game reset.
GrowCallbackList()
seems right, so I suspect our answer is behind door B. Please try changing OOJSFrameCallbacksRemoveAll()
as follows:
Code: Select all
void OOJSFrameCallbacksRemoveAll(void)
{
NSCAssert1(!sRunning, @"%s cannot be called while frame callbacks are running.", __PRETTY_FUNCTION__);
JSContext *context = OOJSAcquireContext();
if (sCount != 0)
{
while (sCount != 0) RemoveCallbackAtIndex(context, sCount - 1);
}
// Remove all GC roots.
OOUInteger i;
for (i = 0; i < sHighWaterMark; i++)
{
JS_RemoveValueRoot(context, &sCallbacks[i].callback);
}
sHighWaterMark = 0;
OOJSRelinquishContext(context);
}