prevent a reference leak when OOR objects are created

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28281 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-07-17 17:52:29 +00:00
parent 251f47d1ea
commit a77bf68f69
5 changed files with 51 additions and 30 deletions

View File

@@ -69,7 +69,8 @@ public:
%extend {
void _setOORInfo(PyObject* _self) {
if (_self && _self != Py_None) {
self->SetClientObject(new wxPyOORClientData(_self));
if (!self->GetClientObject())
self->SetClientObject(new wxPyOORClientData(_self));
}
else {
wxPyOORClientData* data = (wxPyOORClientData*)self->GetClientObject();