mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-21 20:11:24 +00:00
[input] Delay event system init
I think I had though it using a constructor init was ok, but it turns out that was problematic. That, or I missed it in my recent audit. Fixes a sys syserror during shutdown.
This commit is contained in:
parent
9a081b6809
commit
5c72ce10d2
8 changed files with 11 additions and 6 deletions
|
@ -122,6 +122,7 @@ typedef struct IE_event_s {
|
|||
|
||||
typedef int ie_handler_t (const IE_event_t *, void *data);
|
||||
|
||||
void IN_Event_Init (void);
|
||||
int IE_Send_Event (const IE_event_t *event);
|
||||
int IE_Add_Handler (ie_handler_t *event_handler, void *data);
|
||||
void IE_Remove_Handler (int handle);
|
||||
|
|
|
@ -120,6 +120,7 @@ IN_AxisRemoveListener (in_axis_t *axis, axis_listener_t listener, void *data)
|
|||
static void
|
||||
in_axis_shutdown (void *data)
|
||||
{
|
||||
Sys_MaskPrintf (SYS_input, "in_axis_shutdown\n");
|
||||
Hash_DelTable (axis_tab);
|
||||
}
|
||||
|
||||
|
|
|
@ -781,6 +781,7 @@ IN_Binding_Activate (void)
|
|||
static void
|
||||
IN_Binding_Shutdown (void *data)
|
||||
{
|
||||
Sys_MaskPrintf (SYS_input, "IN_Binding_Shutdown\n");
|
||||
for (in_devbindings_t *db = devbindings_list; db; db = db->next) {
|
||||
clear_connection (db);
|
||||
}
|
||||
|
|
|
@ -260,6 +260,7 @@ IN_ButtonClearStates (void)
|
|||
static void
|
||||
in_button_shutdown (void *data)
|
||||
{
|
||||
Sys_MaskPrintf (SYS_input, "in_button_shutdown\n");
|
||||
Hash_DelTable (button_tab);
|
||||
}
|
||||
|
||||
|
|
|
@ -530,9 +530,7 @@ IN_LoadConfig (plitem_t *config)
|
|||
static void
|
||||
IN_shutdown (void *data)
|
||||
{
|
||||
//JOY_Shutdown ();
|
||||
|
||||
Sys_MaskPrintf (SYS_vid, "IN_shutdown\n");
|
||||
Sys_MaskPrintf (SYS_input, "IN_shutdown\n");
|
||||
for (size_t i = in_drivers.size; i-- > 0; ) {
|
||||
in_regdriver_t *rd = &in_drivers.a[i];
|
||||
if (rd->driver.shutdown) {
|
||||
|
@ -548,6 +546,7 @@ void
|
|||
IN_Init (void)
|
||||
{
|
||||
Sys_RegisterShutdown (IN_shutdown, 0);
|
||||
IN_Event_Init ();
|
||||
IN_ButtonInit ();
|
||||
IN_AxisInit ();
|
||||
IMT_Init ();
|
||||
|
|
|
@ -75,6 +75,7 @@ in_evdev_check_select (qf_fd_set *fdset, void *data)
|
|||
static void
|
||||
in_evdev_shutdown (void *data)
|
||||
{
|
||||
Sys_MaskPrintf (SYS_input, "in_evdev_shutdown\n");
|
||||
inputlib_close ();
|
||||
|
||||
for (unsigned i = 0; i < devmap._size; i++) {
|
||||
|
|
|
@ -124,12 +124,12 @@ IE_Get_Focus (void)
|
|||
static void
|
||||
in_event_shutdown (void *data)
|
||||
{
|
||||
Sys_MaskPrintf (SYS_input, "in_event_shutdown\n");
|
||||
DARRAY_CLEAR (&ie_handlers);
|
||||
}
|
||||
|
||||
static void __attribute__((constructor))
|
||||
in_event_init (void)
|
||||
void
|
||||
IN_Event_Init (void)
|
||||
{
|
||||
//FIXME see in_evdev
|
||||
Sys_RegisterShutdown (in_event_shutdown, 0);
|
||||
}
|
||||
|
|
|
@ -939,6 +939,7 @@ static imtcmd_t imt_commands[] = {
|
|||
static void
|
||||
IMT_Shutdown (void *data)
|
||||
{
|
||||
Sys_MaskPrintf (SYS_input, "IMT_Shutdown\n");
|
||||
imt_drop_all_f ();
|
||||
Hash_DelTable (recipe_tab);
|
||||
|
||||
|
|
Loading…
Reference in a new issue