b=417115, animated image causes recursion during shutdown ; r=stuart

This commit is contained in:
vladimir@pobox.com 2008-02-13 22:51:06 -08:00
Родитель 2f94d8d7c7
Коммит 15e811c57a
1 изменённых файлов: 8 добавлений и 3 удалений

Просмотреть файл

@ -110,11 +110,16 @@ private:
void ReleaseCallback() void ReleaseCallback()
{ {
if (mCallbackType == CALLBACK_TYPE_INTERFACE) // if we're the last owner of the callback object, make
// sure that we don't recurse into ReleaseCallback in case
// the callback's destructor calls Cancel() or similar.
PRUint8 cbType = mCallbackType;
mCallbackType = CALLBACK_TYPE_UNKNOWN;
if (cbType == CALLBACK_TYPE_INTERFACE)
NS_RELEASE(mCallback.i); NS_RELEASE(mCallback.i);
else if (mCallbackType == CALLBACK_TYPE_OBSERVER) else if (cbType == CALLBACK_TYPE_OBSERVER)
NS_RELEASE(mCallback.o); NS_RELEASE(mCallback.o);
mCallbackType = CALLBACK_TYPE_UNKNOWN;
} }
nsCOMPtr<nsIThread> mCallingThread; nsCOMPtr<nsIThread> mCallingThread;