mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-08-20 22:06:25 +08:00
We use the wxToolBarTool address as the native toolbar item ID, which must be unique within the application (at least), not just within the toolbar, and triggers an assertion failure if a wxToolbar is destroyed and re-created with item(s) happening to land at the same memory addresses before the underlying NSToolbar is destroyed. This commit changes the ID to include the NSToolbar address so that an ID won't be reused unless an NSToolbar has been fully destroyed and a new one created at the same address. This may also hint at an (existing) bug since the NSToolbar object clearly exists for longer than the wxToolBarTool, and Cocoa _MIGHT_ ask us for the item after it has been deleted, but I'm not familiar enough with macOS to know whether or not this can happen. Closes #26057.