X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e2eafeff03e55e8af173168ec4d4378f5c9d4630..286694ba265d1bf68290cac192bbe54259c313d9:/src/cocoa/toolbar.mm diff --git a/src/cocoa/toolbar.mm b/src/cocoa/toolbar.mm index 3688f0e7b3..30f61996fd 100644 --- a/src/cocoa/toolbar.mm +++ b/src/cocoa/toolbar.mm @@ -253,6 +253,7 @@ bool wxToolBar::Cocoa_mouseDragged(WX_NSEvent theEvent) NSButtonCell *buttonCell = m_mouseDownTool->GetNSButtonCell(); if(buttonCell) { + [buttonCell retain]; [buttonCell setHighlighted: YES]; if([buttonCell trackMouse: theEvent inRect:AddToolPadding(m_mouseDownTool->GetFrameRect()) ofView:m_cocoaNSView @@ -263,6 +264,7 @@ bool wxToolBar::Cocoa_mouseDragged(WX_NSEvent theEvent) wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked after drag!")); } [buttonCell setHighlighted: NO]; + [buttonCell release]; } } return wxToolBarBase::Cocoa_mouseDragged(theEvent); @@ -276,6 +278,7 @@ bool wxToolBar::Cocoa_mouseDown(WX_NSEvent theEvent) NSButtonCell *buttonCell = tool->GetNSButtonCell(); if(buttonCell) { + [buttonCell retain]; m_mouseDownTool = tool; [buttonCell setHighlighted: YES]; if([buttonCell trackMouse: theEvent @@ -287,6 +290,7 @@ bool wxToolBar::Cocoa_mouseDown(WX_NSEvent theEvent) wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked!")); } [buttonCell setHighlighted: NO]; + [buttonCell release]; } } return wxToolBarBase::Cocoa_mouseDown(theEvent);