mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 11:30:06 +01:00
Acquire the GIL before checking for an error
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@71406 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -228,10 +228,12 @@ def run():
|
||||
body="""\
|
||||
wxBitmap* bmp = new wxBitmap(width, height, 24);
|
||||
wxPyCopyBitmapFromBuffer(bmp, (byte*)data->m_ptr, data->m_len, wxBitmapBufferFormat_RGB);
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
if (PyErr_Occurred()) {
|
||||
delete bmp;
|
||||
bmp = NULL;
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return bmp;
|
||||
""")
|
||||
|
||||
@@ -269,10 +271,12 @@ def run():
|
||||
body="""\
|
||||
wxBitmap* bmp = new wxBitmap(width, height, 32);
|
||||
wxPyCopyBitmapFromBuffer(bmp, (byte*)data->m_ptr, data->m_len, wxBitmapBufferFormat_RGBA);
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
if (PyErr_Occurred()) {
|
||||
delete bmp;
|
||||
bmp = NULL;
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return bmp;
|
||||
""")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user