Significantly changed how the Python interpreter lock and thread state

are managed, which should fix the problem of running on a
multi-processor machine.

Some fixes for some of the contributed library modules.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11614 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-09-16 01:51:13 +00:00
parent 72fa862b04
commit 19a97bd6f9
41 changed files with 1706 additions and 1146 deletions

View File

@@ -103,11 +103,11 @@ public:
~wxPyValidator() {
}
wxObject* wxPyValidator::Clone() const {
wxObject* Clone() const {
wxPyValidator* ptr = NULL;
wxPyValidator* self = (wxPyValidator*)this;
bool doSave = wxPyRestoreThread();
wxPyTState* state = wxPyBeginBlockThreads();
if (self->m_myInst.findCallback("Clone")) {
PyObject* ro;
ro = self->m_myInst.callCallbackObj(Py_BuildValue("()"));
@@ -116,13 +116,13 @@ public:
Py_DECREF(ro);
}
}
wxPyEndBlockThreads(state);
// This is very dangerous!!! But is the only way I could find
// to squash a memory leak. Currently it is okay, but if the
// validator architecture in wxWindows ever changes, problems
// could arise.
delete self;
wxPySaveThread(doSave);
return ptr;
}