X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/524c47aa3adf2af11a3069fd5da035a604f08f66..a12482a357a2ef5feb50f9ace8e173f9aed680e0:/src/osx/carbon/taskbar.cpp?ds=inline diff --git a/src/osx/carbon/taskbar.cpp b/src/osx/carbon/taskbar.cpp index ffca169573..49b11122b2 100644 --- a/src/osx/carbon/taskbar.cpp +++ b/src/osx/carbon/taskbar.cpp @@ -41,7 +41,7 @@ public: wxTaskBarIcon *m_parent; class wxTaskBarIconWindow *m_menuEventWindow; - DECLARE_NO_COPY_CLASS(wxTaskBarIconImpl) + wxDECLARE_NO_COPY_CLASS(wxTaskBarIconImpl); }; //----------------------------------------------------------------------------- @@ -141,7 +141,7 @@ wxDockEventHandler(EventHandlerCallRef WXUNUSED(inHandlerCallRef), wxDockTaskBarIcon* pTB = (wxDockTaskBarIcon*) pData; const UInt32 eventClass = GetEventClass(inEvent); const UInt32 eventKind = GetEventKind(inEvent); - + OSStatus err = eventNotHandledErr; // Handle wxTaskBar menu events (note that this is a global event handler @@ -347,8 +347,7 @@ wxMenu * wxDockTaskBarIcon::DoCreatePopupMenu() if (theNewMenu) { - if (m_pMenu) - delete m_pMenu; + delete m_pMenu; m_pMenu = theNewMenu; m_pMenu->SetInvokingWindow(m_menuEventWindow); } @@ -410,11 +409,7 @@ bool wxDockTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& WXUNUSED(too //----------------------------------------------------------------------------- bool wxDockTaskBarIcon::RemoveIcon() { - if (m_pMenu) - { - delete m_pMenu; - m_pMenu = NULL; - } + wxDELETE(m_pMenu); // restore old icon to the dock OSStatus err = RestoreApplicationDockTileImage(); @@ -442,8 +437,7 @@ bool wxDockTaskBarIcon::PopupMenu(wxMenu *menu) { wxASSERT(menu != NULL); - if (m_pMenu) - delete m_pMenu; + delete m_pMenu; // start copy of menu m_pMenu = wxDeepCopyMenu(menu); @@ -472,7 +466,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxTaskBarIcon, wxEvtHandler) // actually seperate programs that also require a special undocumented id // hack and other such fun stuff). //----------------------------------------------------------------------------- -wxTaskBarIcon::wxTaskBarIcon(wxTaskBarIconType nType) +wxTaskBarIcon::wxTaskBarIcon(wxTaskBarIconType WXUNUSED_UNLESS_DEBUG(nType)) { wxASSERT_MSG( nType == DOCK,