Correctly handle the release of ownership of the wx.FSFile returned
from wx.FileSystemHandler.OpenFile. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1673,6 +1673,8 @@ extern wxPyApp *wxPythonApp;
|
||||
obj, s)); \
|
||||
if (ro) { \
|
||||
wxPyConvertSwigPtr(ro, (void **)&rval, wxT("wxFSFile")); \
|
||||
/* release ownership of the C++ wx.FSFile object. */ \
|
||||
PyObject_SetAttrString(ro, "thisown", Py_False); \
|
||||
Py_DECREF(ro); \
|
||||
} \
|
||||
Py_DECREF(obj); \
|
||||
|
@@ -26,13 +26,15 @@
|
||||
class wxFSFile : public wxObject
|
||||
{
|
||||
public:
|
||||
%pythonAppend wxFSFile
|
||||
"self.thisown = 0 # It will normally be deleted by the user of the wx.FileSystem";
|
||||
%typemap(out) wxFSFile*; // turn off this typemap
|
||||
|
||||
wxFSFile(wxInputStream *stream, const wxString& loc,
|
||||
const wxString& mimetype, const wxString& anchor,
|
||||
wxDateTime modif);
|
||||
|
||||
// Turn it back on.
|
||||
%typemap(out) wxFSFile* { $result = wxPyMake_wxObject($1, $owner); }
|
||||
|
||||
~wxFSFile();
|
||||
|
||||
wxInputStream *GetStream();
|
||||
|
Reference in New Issue
Block a user