added check for NULL Clone() return
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12601 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -629,6 +629,13 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event)
|
|||||||
{
|
{
|
||||||
// 1) Add event to list of pending events of this event handler
|
// 1) Add event to list of pending events of this event handler
|
||||||
|
|
||||||
|
wxEvent *eventCopy = event.Clone();
|
||||||
|
|
||||||
|
// we must be able to copy the events here so the event class must
|
||||||
|
// implement Clone() properly instead of just providing a NULL stab for it
|
||||||
|
wxCHECK_RET( eventCopy,
|
||||||
|
_T("events of this type aren't supposed to be posted") );
|
||||||
|
|
||||||
#if defined(__VISAGECPP__)
|
#if defined(__VISAGECPP__)
|
||||||
wxENTER_CRIT_SECT( m_eventsLocker);
|
wxENTER_CRIT_SECT( m_eventsLocker);
|
||||||
#else
|
#else
|
||||||
@@ -638,9 +645,7 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event)
|
|||||||
if ( !m_pendingEvents )
|
if ( !m_pendingEvents )
|
||||||
m_pendingEvents = new wxList;
|
m_pendingEvents = new wxList;
|
||||||
|
|
||||||
wxEvent *event2 = event.Clone();
|
m_pendingEvents->Append(eventCopy);
|
||||||
|
|
||||||
m_pendingEvents->Append(event2);
|
|
||||||
|
|
||||||
#if defined(__VISAGECPP__)
|
#if defined(__VISAGECPP__)
|
||||||
wxLEAVE_CRIT_SECT( m_eventsLocker);
|
wxLEAVE_CRIT_SECT( m_eventsLocker);
|
||||||
|
Reference in New Issue
Block a user