Skip to content

Conversation

@connorjclark
Copy link
Contributor

Prevents this ASSERT from being hit:

Assertion failed: (vec->_itemsize > 0), function _al_vector_alloc_back, file vector.c, line 174.

__pthread_kill (@__pthread_kill:6)
pthread_kill (@pthread_kill:65)
abort (@abort:39)
__assert_rtn (@err:3)
_al_vector_alloc_back (/Users/connorclark/code/allegro5/src/misc/vector.c:174)
find_or_insert_joystick (/Users/connorclark/code/allegro5/src/macosx/hidjoy.m:176)
add_joystick_device (/Users/connorclark/code/allegro5/src/macosx/hidjoy.m:513)
device_add_callback (/Users/connorclark/code/allegro5/src/macosx/hidjoy.m:619)
__IOHIDManagerDeviceApplier (@__IOHIDManagerDeviceApplier:203)
__CFSetApplyFunction_block_invoke (@__CFSetApplyFunction_block_invoke:9)
CFBasicHashApply (@CFBasicHashApply:36)
CFSetApplyFunction (@CFSetApplyFunction:47)
__IOHIDManagerInitialEnumCallback (@__IOHIDManagerInitialEnumCallback:29)
...

(commit body)

device_add_callback could fire before the joysticks vector is initialized if the controller is already enabled and connects instantly.

As far as I can tell, this bug has been present for 15+ years.

device_add_callback could fire before the joysticks vector is
initialized if the controller is already enabled and connects instantly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant