Updates to match recent CVS changes.

Plugged some resource count leaks.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15042 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-04-08 20:56:34 +00:00
parent 7ff3f36748
commit db0ff83efb
19 changed files with 427 additions and 81 deletions

View File

@@ -1070,8 +1070,9 @@ public:
#define IMP_PYCALLBACK_wxSize__pure(CLASS, PCLASS, CBNAME) \
wxSize CLASS::CBNAME() { \
const char* errmsg = #CBNAME " should return a 2-tuple of integers or a wxSize object."; \
wxSize rval(0,0); \
wxPyBeginBlockThreads(); \
wxPyBeginBlockThreads(); \
if (wxPyCBH_findCallback(m_myInst, #CBNAME)) { \
PyObject* ro; \
wxSize* ptr; \
@@ -1079,10 +1080,23 @@ public:
if (ro) { \
if (! SWIG_GetPtrObj(ro, (void **)&ptr, "_wxSize_p")) \
rval = *ptr; \
else if (PySequence_Check(ro) && PyObject_Length(ro) == 2) { \
PyObject* o1 = PySequence_GetItem(ro, 0); \
PyObject* o2 = PySequence_GetItem(ro, 1); \
if (PyNumber_Check(o1) && PyNumber_Check(o2)) \
rval = wxSize(PyInt_AsLong(o1), PyInt_AsLong(o2)); \
else \
PyErr_SetString(PyExc_TypeError, errmsg); \
Py_DECREF(o1); \
Py_DECREF(o2); \
} \
else { \
PyErr_SetString(PyExc_TypeError, errmsg); \
} \
Py_DECREF(ro); \
} \
} \
wxPyEndBlockThreads(); \
wxPyEndBlockThreads(); \
return rval; \
}