[~] fix: processing debug events exception

git-svn-id: https://pykd.svn.codeplex.com/svn@69473 9b283d60-5439-405e-af05-b73fd8c4d996
This commit is contained in:
SND\EreTIk_cp 2011-09-01 12:25:54 +00:00
parent e4bbc369f9
commit 105ba17ade
2 changed files with 5 additions and 4 deletions

View File

@ -25,7 +25,7 @@ setExecutionStatus()
do { do {
{ {
PyThread_StateRestore state; PyThread_StateRestore state(dbgExt->getThreadState());
hres = dbgExt->control->WaitForEvent( 0, INFINITE ); hres = dbgExt->control->WaitForEvent( 0, INFINITE );

View File

@ -18,7 +18,7 @@ public:
PyThread_StateSave( PyThreadState **state ) PyThread_StateSave( PyThreadState **state )
: m_state(NULL) : m_state(NULL)
{ {
if ( *state != NULL ) if ( *state )
{ {
m_state = state; m_state = state;
PyEval_RestoreThread( *m_state ); PyEval_RestoreThread( *m_state );
@ -26,7 +26,7 @@ public:
} }
~PyThread_StateSave() { ~PyThread_StateSave() {
if (m_state) if ( m_state )
*m_state =PyEval_SaveThread(); *m_state =PyEval_SaveThread();
} }
@ -49,7 +49,7 @@ public:
} }
PyThread_StateRestore( PyThreadState **state ) { PyThread_StateRestore( PyThreadState **state ) {
if ( *state != NULL ) if ( *state )
{ {
m_state = state; m_state = state;
*m_state =PyEval_SaveThread(); *m_state =PyEval_SaveThread();
@ -57,6 +57,7 @@ public:
} }
~PyThread_StateRestore() { ~PyThread_StateRestore() {
if (*m_state)
PyEval_RestoreThread( *m_state ); PyEval_RestoreThread( *m_state );
} }