I am currently using NSToolbar in my application and for some reason whenever I am trying to add an item from my toolbar second time my application crashes with error Assertion failure in -[NSToolbar _forceInsertItem:atIndex:].
Issue only occurs in latest macOS Monterey. In all older versions of macOS this is working fine.
I tried to use Autoreleasepool to release local variables memory which I think was the reason for crash but application still crashes. Is there any change in Cocoa memory management system in macOS Monterey ?