From 105ba17adeb23115e8c8ce706cc3d8891071062c Mon Sep 17 00:00:00 2001 From: "SND\\EreTIk_cp" Date: Thu, 1 Sep 2011 12:25:54 +0000 Subject: [PATCH] [~] fix: processing debug events exception git-svn-id: https://pykd.svn.codeplex.com/svn@69473 9b283d60-5439-405e-af05-b73fd8c4d996 --- pykd/dbgcmd.h | 2 +- pykd/pyaux.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pykd/dbgcmd.h b/pykd/dbgcmd.h index b9d8594..d6e5bae 100644 --- a/pykd/dbgcmd.h +++ b/pykd/dbgcmd.h @@ -25,7 +25,7 @@ setExecutionStatus() do { { - PyThread_StateRestore state; + PyThread_StateRestore state(dbgExt->getThreadState()); hres = dbgExt->control->WaitForEvent( 0, INFINITE ); diff --git a/pykd/pyaux.h b/pykd/pyaux.h index 3768aa5..cf83a13 100644 --- a/pykd/pyaux.h +++ b/pykd/pyaux.h @@ -18,7 +18,7 @@ public: PyThread_StateSave( PyThreadState **state ) : m_state(NULL) { - if ( *state != NULL ) + if ( *state ) { m_state = state; PyEval_RestoreThread( *m_state ); @@ -26,7 +26,7 @@ public: } ~PyThread_StateSave() { - if (m_state) + if ( m_state ) *m_state =PyEval_SaveThread(); } @@ -49,7 +49,7 @@ public: } PyThread_StateRestore( PyThreadState **state ) { - if ( *state != NULL ) + if ( *state ) { m_state = state; *m_state =PyEval_SaveThread(); @@ -57,6 +57,7 @@ public: } ~PyThread_StateRestore() { + if (*m_state) PyEval_RestoreThread( *m_state ); }