Just to confirm once upgraded to 3.1.3, no more errors when rapidly clicking buttons to start/stop threads.
...& the new skins look nice, looking forward to 3.1.4
wxThread->Delete() - Exception thrown: read access violation. Topic is solved
Re: wxThread->Delete() - Exception thrown: read access violation.
wxWidgets(v3.2.2.1) - Vs2022(v143) - Win10(x64) - DialogBlocks(v5.16.5_Unicode)
Re: wxThread->Delete() - Exception thrown: read access violation.
Hi,
Looks like the release already been done.
Thank you.
Looks like the release already been done.
Thank you.
Re: wxThread->Delete() - Exception thrown: read access violation.
Just for the future reference (I always use the similar code for worker and GUI threads communication example): It took me almost two years, but I finally figured out why the code crashes with wxWidgets 3.0 but not 3.1.
It is due to a difference in wxThread::Delete() call, which means wxThread::Delete(NULL, wxTHREAD_WAIT_DEFAULT).
Unlike wxWidgets 3.1, wxWidgets 3.0 has by default WXWIN_COMPATIBILITY_2_8 set. When WXWIN_COMPATIBILITY_2_8 is set, wxTHREAD_WAIT_DEFAULT evaluates to wxTHREAD_WAIT_YIELD, but when it is not set, it evaluates to wxTHREAD_WAIT_BLOCK.
As documented, wxTHREAD_WAIT_YIELD is dangerous because it allows processing events even while the thread is being deleted, which led to the crashes reported in this thread.
So in wxWidgets 3.0 (or whenever WXWIN_COMPATIBILITY_2_8 is set), one should not use just
but instead
It is due to a difference in wxThread::Delete() call, which means wxThread::Delete(NULL, wxTHREAD_WAIT_DEFAULT).
Unlike wxWidgets 3.1, wxWidgets 3.0 has by default WXWIN_COMPATIBILITY_2_8 set. When WXWIN_COMPATIBILITY_2_8 is set, wxTHREAD_WAIT_DEFAULT evaluates to wxTHREAD_WAIT_YIELD, but when it is not set, it evaluates to wxTHREAD_WAIT_BLOCK.
As documented, wxTHREAD_WAIT_YIELD is dangerous because it allows processing events even while the thread is being deleted, which led to the crashes reported in this thread.
So in wxWidgets 3.0 (or whenever WXWIN_COMPATIBILITY_2_8 is set), one should not use just
Code: Select all
m_dataLoadingThread->Delete();
Code: Select all
m_dataLoadingThread->Delete(NULL, wxTHREAD_WAIT_BLOCK);
Re: wxThread->Delete() - Exception thrown: read access violation.
PB,
Time for another issue?
Thank you.
Time for another issue?
Thank you.
Re: wxThread->Delete() - Exception thrown: read access violation.
No, it was my error, I did not RTFM.