X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/de20db997ddf7ee903076e72e9918caa2e269c19..9cf99fc093f9c45b6b5d8d8b357699d826c9916a:/wxPython/src/streams.i?ds=sidebyside diff --git a/wxPython/src/streams.i b/wxPython/src/streams.i index 84020cb393..57daa51833 100644 --- a/wxPython/src/streams.i +++ b/wxPython/src/streams.i @@ -53,28 +53,7 @@ if ($source) { _ptr = new wxPyInputStream($source); } - if (_ptr) { - char swigptr[64]; - SWIG_MakePtr(swigptr, _ptr, "_wxPyInputStream_p"); - - PyObject* classobj = PyDict_GetItemString(wxPython_dict, "wxInputStreamPtr"); - if (! classobj) { - Py_INCREF(Py_None); - $target = Py_None; - } else { - PyObject* arg = Py_BuildValue("(s)", swigptr); - $target = PyInstance_New(classobj, arg, NULL); - Py_DECREF(arg); - - // set ThisOwn - PyObject* one = PyInt_FromLong(1); - PyObject_SetAttrString($target, "thisown", one); - Py_DECREF(one); - } - } else { - Py_INCREF(Py_None); - $target = Py_None; - } + $target = wxPyConstructObject(_ptr, "wxInputStream", TRUE); } //---------------------------------------------------------------------- @@ -505,3 +484,10 @@ public: } +//---------------------------------------------------------------------- + +%init %{ + wxPyPtrTypeMap_Add("wxInputStream", "wxPyInputStream"); +%} + +//----------------------------------------------------------------------