Ensure we don't crash in wxProgressDialog::DoGetPosition()
Check that we do have the shared data before dereferencing the pointer to it. While this normally will always be the case, it could be null if some error happened, so add a check for it, just as we already do it elsewhere.
This commit is contained in:
@@ -746,6 +746,7 @@ void wxProgressDialog::DoGetPosition(int *x, int *y) const
|
|||||||
if ( HasNativeTaskDialog() )
|
if ( HasNativeTaskDialog() )
|
||||||
{
|
{
|
||||||
wxPoint pos;
|
wxPoint pos;
|
||||||
|
if ( m_sharedData )
|
||||||
{
|
{
|
||||||
wxCriticalSectionLocker locker(m_sharedData->m_cs);
|
wxCriticalSectionLocker locker(m_sharedData->m_cs);
|
||||||
pos = m_sharedData->m_winPosition;
|
pos = m_sharedData->m_winPosition;
|
||||||
|
Reference in New Issue
Block a user