Detech dispatch after Handles are freed (bug 5853, r=asherkin).

This commit is contained in:
Kyle Sanderson 2013-09-14 12:23:04 -04:00
parent d808d6d8a5
commit ed6fe7519a

View File

@ -899,10 +899,6 @@ bool HandleSystem::RemoveType(HandleType_t type, IdentityToken_t *ident)
m_Types[++m_FreeTypes].freeID = type; m_Types[++m_FreeTypes].freeID = type;
} }
/* Invalidate the type now */
IHandleTypeDispatch *dispatch = pType->dispatch;
pType->dispatch = NULL;
/* Make sure nothing is using this type. */ /* Make sure nothing is using this type. */
if (pType->opened) if (pType->opened)
{ {
@ -924,6 +920,9 @@ bool HandleSystem::RemoveType(HandleType_t type, IdentityToken_t *ident)
} }
} }
/* Invalidate the type now */
pType->dispatch = NULL;
/* Remove it from the type cache. */ /* Remove it from the type cache. */
if (!pType->name.isVoid()) if (!pType->name.isVoid())
m_TypeLookup.remove(pType->name.chars()); m_TypeLookup.remove(pType->name.chars());