From ed6fe7519a63e19588f6a4d314a6a0c3a03708e5 Mon Sep 17 00:00:00 2001 From: Kyle Sanderson Date: Sat, 14 Sep 2013 12:23:04 -0400 Subject: [PATCH] Detech dispatch after Handles are freed (bug 5853, r=asherkin). --- core/logic/HandleSys.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/logic/HandleSys.cpp b/core/logic/HandleSys.cpp index 6a109e10..b1aaf85d 100644 --- a/core/logic/HandleSys.cpp +++ b/core/logic/HandleSys.cpp @@ -899,10 +899,6 @@ bool HandleSystem::RemoveType(HandleType_t type, IdentityToken_t *ident) m_Types[++m_FreeTypes].freeID = type; } - /* Invalidate the type now */ - IHandleTypeDispatch *dispatch = pType->dispatch; - pType->dispatch = NULL; - /* Make sure nothing is using this type. */ 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. */ if (!pType->name.isVoid()) m_TypeLookup.remove(pType->name.chars());