Carbon Commands on COCOA build app

I have an application (for MAS), that was complete created with Xojo without Carbon interface (2014R2).I have made a new release and send it to MAS. Now I get error messages from the customers with this error, when they use the context menu:

ListboxAttachment_ContextualMenuAction%b%o<WindowAttachments.WindowAttachments>oo
Delegate.IM_Invoke%b%oo
AddHandler.Stub.4%b%o
XojoFramework$6683
XojoFramework$6715
XojoFramework$1817
XojoFramework$868
XojoFramework$876
-[NSObject performSelector:withObject:]
__36-[NSApplication sendAction:to:from:]_block_invoke
_os_activity_initiate
-[NSApplication sendAction:to:from:]
-[NSMenuItem _corePerformAction]
-[NSCarbonMenuImpl performActionWithHighlightingForItemAtIndex:]
-[NSMenu _performActionWithHighlightingForItemAtIndex:sendAccessibilityNotification:]
__38-[NSMenu performActionForItemAtIndex:]_block_invoke
_os_activity_initiate
-[NSMenu performActionForItemAtIndex:]
-[NSMenu _internalPerformActionForItemAtIndex:]
-[NSMenuItem _internalPerformActionThroughMenuIfPossible]
-[NSCarbonMenuImpl _carbonCommandProcessEvent:handlerCallRef:]
NSSLMMenuEventHandler
_Z22_InvokeEventHandlerUPPP25OpaqueEventHandlerCallRefP14OpaqueEventRefPvPFlS0_S2_S3_E
_ZL23DispatchEventToHandlersP14EventTargetRecP14OpaqueEventRefP14HandlerCallRec
_ZL30SendEventToEventTargetInternalP14OpaqueEventRefP20OpaqueEventTargetRefP14HandlerCallRec
SendEventToEventTarget
_ZL18SendHICommandEventmPK9HICommandmmhPKvP20OpaqueEventTargetRefS5_PP14OpaqueEventRef
SendMenuCommandWithContextAndModifiers
SendMenuItemSelectedEvent
ZL19FinishMenuSelectionP13SelectionDataP10MenuResultS2
_ZL19PopUpMenuSelectCoreP8MenuData5PointdS1_tjPK4RecttmS4_S4_PK14__CFDictionaryPK10__CFStringPP13OpaqueMenuRefPt
_ZL26_HandlePopUpMenuSelection8P13OpaqueMenuRefP14OpaqueEventRefm5PointtjPK4RecttS6_S6_PK14__CFDictionaryPK10__CFStringPS0_Pt
_HandlePopUpMenuSelectionWithDictionary
_NSSLMPopUpCarbonMenu3
-[NSCarbonMenuImpl _popUpContextMenu:withEvent:forView:withFont:]
-[NSMenu _popUpContextMenu:withEvent:forView:withFont:]
-[NSMenu _popUpContextMenu:withEvent:forView:]
-[NSMenu _popUpMenuWithEvent:forView:]
-[NSView rightMouseDown:]

Why the ContextMenu fires Carbon APIs or Events?
• NSCarbonMenuImpl _carbonCommandProcessEvent
• _NSSLMPopUpCarbonMenu3

And what is the reason why this generates an error?

The customer uses this
OS X Version 10.10.3 (Build 14D136)
Memory 4GB (MacBook Air)

I could not reproduce this error on my MacPro with the same OS. I have some other customers with other applications from me with errors that can not reproduce on my own hardware (MacbookPro 13" 2010, MacbookPro 15", 2011 or my MacPro 2010). All of these customers using a MacBook Air.

A great deal of Cocoa internally relies on Carbon :slight_smile:

Hard to tell what the error is without a full crash log though

EDIT : Although it does look like an unhandled exception

I have found the error. In the ContructContextMenu event I must check, if the Listbox has one or more entries.

if Listbox.Listcount > 0 then
dim n as new MenuItem
n.name “Rename”
base.append n
end if