1. Initialize m_mouseDownTool = NULL. Fixes crash when clicking a non-tool part of the toolbar before clicking a tool.
2. Added wxAutoNSAutoreleasePool to CreateButtonCell() and Realize() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24887 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -147,6 +147,8 @@ wxToolBarTool::~wxToolBarTool()
|
|||||||
|
|
||||||
bool wxToolBarTool::CreateButtonCell()
|
bool wxToolBarTool::CreateButtonCell()
|
||||||
{
|
{
|
||||||
|
wxAutoNSAutoreleasePool pool;
|
||||||
|
|
||||||
NSImage *nsimage = [m_bmpNormal.GetNSImage(true) retain];
|
NSImage *nsimage = [m_bmpNormal.GetNSImage(true) retain];
|
||||||
m_cocoaNSButtonCell = [[NSButtonCell alloc] initTextCell:nil];
|
m_cocoaNSButtonCell = [[NSButtonCell alloc] initTextCell:nil];
|
||||||
[m_cocoaNSButtonCell setImage:nsimage];
|
[m_cocoaNSButtonCell setImage:nsimage];
|
||||||
@@ -205,6 +207,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxToolBar, wxControl)
|
|||||||
void wxToolBar::Init()
|
void wxToolBar::Init()
|
||||||
{
|
{
|
||||||
m_owningFrame = NULL;
|
m_owningFrame = NULL;
|
||||||
|
m_mouseDownTool = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxToolBar::~wxToolBar()
|
wxToolBar::~wxToolBar()
|
||||||
@@ -327,6 +330,8 @@ bool wxToolBar::Cocoa_mouseDown(WX_NSEvent theEvent)
|
|||||||
|
|
||||||
bool wxToolBar::Realize()
|
bool wxToolBar::Realize()
|
||||||
{
|
{
|
||||||
|
wxAutoNSAutoreleasePool pool;
|
||||||
|
|
||||||
wxToolBarToolsList::compatibility_iterator node;
|
wxToolBarToolsList::compatibility_iterator node;
|
||||||
NSSize totalSize = NSZeroSize;
|
NSSize totalSize = NSZeroSize;
|
||||||
// This is for horizontal, TODO: vertical
|
// This is for horizontal, TODO: vertical
|
||||||
|
Reference in New Issue
Block a user