]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/helpers.cpp
restore cvs up
[wxWidgets.git] / wxPython / src / helpers.cpp
index dfafce7dc56a492a1f5faa9d965d44ce2ec272e3..c38e2f36485a55c2eb7d8553eb549c5f5575f061 100644 (file)
@@ -1260,7 +1260,7 @@ wxPyCBInputStream::wxPyCBInputStream(const wxPyCBInputStream& other)
 
 
 wxPyCBInputStream::~wxPyCBInputStream() {
-    wxPyBlock_t blocked;
+    wxPyBlock_t blocked = wxPyBlock_t_default;
     if (m_block) blocked = wxPyBeginBlockThreads();
     Py_XDECREF(m_read);
     Py_XDECREF(m_seek);
@@ -1270,7 +1270,7 @@ wxPyCBInputStream::~wxPyCBInputStream() {
 
 
 wxPyCBInputStream* wxPyCBInputStream::create(PyObject *py, bool block) {
-    wxPyBlock_t blocked;
+    wxPyBlock_t blocked = wxPyBlock_t_default;
     if (block) blocked = wxPyBeginBlockThreads();
 
     PyObject* read = getMethod(py, "read");
@@ -1873,8 +1873,7 @@ wxString* wxString_in_helper(PyObject* source) {
     target = new wxString();
     size_t len = PyUnicode_GET_SIZE(uni);
     if (len) {
-        PyUnicode_AsWideChar((PyUnicodeObject*)uni, target->GetWriteBuf(len), len);
-        target->UngetWriteBuf(len);
+        PyUnicode_AsWideChar((PyUnicodeObject*)uni, wxStringBuffer(*target, len), len);
     }
 
     if (PyString_Check(source))
@@ -1916,8 +1915,7 @@ wxString Py2wxString(PyObject* source)
     }
     size_t len = PyUnicode_GET_SIZE(uni);
     if (len) {
-        PyUnicode_AsWideChar((PyUnicodeObject*)uni, target.GetWriteBuf(len), len);
-        target.UngetWriteBuf();
+        PyUnicode_AsWideChar((PyUnicodeObject*)uni, wxStringBuffer(target, len), len);
     }
 
     if (!PyUnicode_Check(source))