From a155809447b8b529e22c6c931521b93d2bdefe2a Mon Sep 17 00:00:00 2001 From: janwas Date: Mon, 21 Feb 2011 09:41:11 +0000 Subject: [PATCH] avoid crash due to null pointer in profiler (triggered by returning from the root node) This was SVN commit r8966. --- source/ps/Profile.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/ps/Profile.cpp b/source/ps/Profile.cpp index 21d2ffc39c..6c2b4de656 100644 --- a/source/ps/Profile.cpp +++ b/source/ps/Profile.cpp @@ -653,7 +653,11 @@ void CProfileManager::StartScript( const char* name ) void CProfileManager::Stop() { if( current->Return() ) - current = current->GetParent(); + { + // (jw: for reasons unknown, current == root when called from main.cpp:293) + if(current != root) + current = current->GetParent(); + } } void CProfileManager::Reset()