safe destruction, even if redraws might be triggered
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26056 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -72,16 +72,19 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect
|
|||||||
Cell cell, short dataOffset, short dataLength,
|
Cell cell, short dataOffset, short dataLength,
|
||||||
ListHandle listHandle )
|
ListHandle listHandle )
|
||||||
{
|
{
|
||||||
|
wxListBox* list;
|
||||||
|
list = (wxListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) );
|
||||||
|
if ( list == NULL )
|
||||||
|
return ;
|
||||||
|
|
||||||
GrafPtr savePort;
|
GrafPtr savePort;
|
||||||
GrafPtr grafPtr;
|
GrafPtr grafPtr;
|
||||||
RgnHandle savedClipRegion;
|
RgnHandle savedClipRegion;
|
||||||
SInt32 savedPenMode;
|
SInt32 savedPenMode;
|
||||||
wxListBox* list;
|
|
||||||
GetPort(&savePort);
|
GetPort(&savePort);
|
||||||
SetPort((**listHandle).port);
|
SetPort((**listHandle).port);
|
||||||
grafPtr = (**listHandle).port ;
|
grafPtr = (**listHandle).port ;
|
||||||
// typecast our refCon
|
// typecast our refCon
|
||||||
list = (wxListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) );
|
|
||||||
|
|
||||||
// Calculate the cell rect.
|
// Calculate the cell rect.
|
||||||
|
|
||||||
@@ -313,6 +316,8 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
wxListBox::~wxListBox()
|
wxListBox::~wxListBox()
|
||||||
{
|
{
|
||||||
FreeData() ;
|
FreeData() ;
|
||||||
|
// avoid access during destruction
|
||||||
|
SetControlReference( (ControlHandle) m_macControl , NULL ) ;
|
||||||
if ( m_macList )
|
if ( m_macList )
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
|
@@ -72,16 +72,19 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect
|
|||||||
Cell cell, short dataOffset, short dataLength,
|
Cell cell, short dataOffset, short dataLength,
|
||||||
ListHandle listHandle )
|
ListHandle listHandle )
|
||||||
{
|
{
|
||||||
|
wxListBox* list;
|
||||||
|
list = (wxListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) );
|
||||||
|
if ( list == NULL )
|
||||||
|
return ;
|
||||||
|
|
||||||
GrafPtr savePort;
|
GrafPtr savePort;
|
||||||
GrafPtr grafPtr;
|
GrafPtr grafPtr;
|
||||||
RgnHandle savedClipRegion;
|
RgnHandle savedClipRegion;
|
||||||
SInt32 savedPenMode;
|
SInt32 savedPenMode;
|
||||||
wxListBox* list;
|
|
||||||
GetPort(&savePort);
|
GetPort(&savePort);
|
||||||
SetPort((**listHandle).port);
|
SetPort((**listHandle).port);
|
||||||
grafPtr = (**listHandle).port ;
|
grafPtr = (**listHandle).port ;
|
||||||
// typecast our refCon
|
// typecast our refCon
|
||||||
list = (wxListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) );
|
|
||||||
|
|
||||||
// Calculate the cell rect.
|
// Calculate the cell rect.
|
||||||
|
|
||||||
@@ -313,6 +316,8 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
|
|||||||
wxListBox::~wxListBox()
|
wxListBox::~wxListBox()
|
||||||
{
|
{
|
||||||
FreeData() ;
|
FreeData() ;
|
||||||
|
// avoid access during destruction
|
||||||
|
SetControlReference( (ControlHandle) m_macControl , NULL ) ;
|
||||||
if ( m_macList )
|
if ( m_macList )
|
||||||
{
|
{
|
||||||
#if !TARGET_CARBON
|
#if !TARGET_CARBON
|
||||||
|
Reference in New Issue
Block a user