Keep a reference to the stream passed to wx.FSFile

This commit is contained in:
Robin Dunn
2019-10-22 16:07:06 -07:00
parent edaf5c96d7
commit afcd5f2d97
3 changed files with 4 additions and 4 deletions

View File

@@ -67,8 +67,9 @@ def run():
c = module.find('wxFSFile')
c.addPrivateCopyCtor()
c.find('wxFSFile.stream').transfer = True
c.find('DetachStream').transferBack = True
c.find('wxFSFile.stream').keepReference = True
#c.find('wxFSFile.stream').transfer = True
#c.find('DetachStream').transferBack = True
c = module.find('wxFilterFSHandler')
_fixHandlerClass(c)

View File

@@ -85,7 +85,7 @@ def run():
}
// otherwise do the conversion
*sipCppPtr = new wxPyInputStream(sipPy);
return sipGetState(sipTransferObj);
return 0; //sipGetState(sipTransferObj);
"""
# Add Python file-like methods so a wx.InputStream can be used as if it

View File

@@ -96,7 +96,6 @@ protected:
o = bufsize;
memcpy((char*)buffer, PyBytes_AsString(result), o); // strings only, not unicode...
Py_DECREF(result);
}
else
m_lasterror = wxSTREAM_READ_ERROR;