Fix macOS hotkey editor compatibility issues#616
Conversation
Was this crash purely due to incorrect wxWidgets usage in Aegisub, or was this also (maybe partially) a wxWidgets bug? If it's the latter, this should also be reported upstream. |
This looks like incorrect usage on Aegisub’s side. We were still exposing the item through GetChildren() after telling wxWidgets it had been deleted. The backing object was then erased immediately afterwards, so wx / NSOutlineView could end up with a stale wxDataViewItem pointer. After removing it from the visible list before ItemDeleted(), wxWidgets no longer sees that stale item. wxWidgets could perhaps be more defensive on macOS, but I don’t think this is enough for a bug report. |
|
Thanks, I see now. I had a chance to review the changes themselves now, and the code LGTM as far as I can see, but could you split it up into a few smaller commits? Something like
|
Fixes #357
Use the native wxDataViewChoiceRenderer for the hotkey command column on macOS, since wxWidgets does not fully support custom data view renderers there. The choice list is populated from the same registered command IDs used by other platforms, so automation commands use the normal command names without any macOS-specific lookup behavior.
Also fix a crash when deleting hotkeys on macOS by removing the item from the visible item list before erasing the underlying model object, avoiding a stale wxDataViewItem pointer being queried by NSOutlineView.