fix handle is -1

This commit is contained in:
Irony 2018-03-13 12:37:47 +08:00
parent 57825f42ac
commit de6849e860

View file

@ -69,12 +69,16 @@ class Window(QWidget):
self.suspendButton.setEnabled(True) self.suspendButton.setEnabled(True)
def onSuspendThread(self): def onSuspendThread(self):
if self._thread.handle == -1:
return print('handle is wrong')
ret = SuspendThread(self._thread.handle) ret = SuspendThread(self._thread.handle)
print('挂起线程', self._thread.handle, ret) print('挂起线程', self._thread.handle, ret)
self.suspendButton.setEnabled(False) self.suspendButton.setEnabled(False)
self.resumeButton.setEnabled(True) self.resumeButton.setEnabled(True)
def onResumeThread(self): def onResumeThread(self):
if self._thread.handle == -1:
return print('handle is wrong')
ret = ResumeThread(self._thread.handle) ret = ResumeThread(self._thread.handle)
print('恢复线程', self._thread.handle, ret) print('恢复线程', self._thread.handle, ret)
self.suspendButton.setEnabled(True) self.suspendButton.setEnabled(True)