Files
wxWidgets/include
Daniel Collins c8880e21b1 Avoid duplicate toolbar item IDs on macOS
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.
2026-01-02 17:35:33 +01:00
..