Commits

Mark Hammond committed 3fa6523

Explicit them implicit release would deadlock (and killed win32gui in some
cases)

  • Participants
  • Parent commits 820483e

Comments (0)

Files changed (1)

win32/src/PyWinTypes.h

 public:
 	CEnterLeavePython() {
 		acquire();
+		released = FALSE;
 	}
 	void acquire(void) {
 		state = PyGILState_Ensure();
 		release();
 	}
 	void release(void) {
-		PyGILState_Release(state);
+		if (!released) {
+			PyGILState_Release(state);
+			released = TRUE;
+		}
 	}
 private:
 	PyGILState_STATE state;
+	BOOL released;
 };
 #endif // PYWIN_USE_GILSTATE