Comment 11 for bug 1794292

The patch should be fine, in fact I was debugging it and it looks like that the renderers where disactivated before than the renderer keyboards, thus the crash.

This was some gdb debugging, in case it might be useful in future:

(gdb) bt
#0 0x00007ff2a56137f9 in ply_renderer_set_handler_for_input_source (renderer=<optimized out>,
    input_source=0x5625cf38ced0, handler=0x0, user_data=0x0) at ply-renderer.c:406
#1 0x00007ff2a560d5ac in ply_keyboard_stop_watching_for_renderer_input (keyboard=0x5625cf38dad0)
    at ply-keyboard.c:406
#2 ply_keyboard_stop_watching_for_input (keyboard=keyboard@entry=0x5625cf38dad0) at ply-keyboard.c:406
#3 0x00007ff2a560cb3b in ply_device_manager_deactivate_keyboards (manager=0x5625cf37ef70)
    at ply-device-manager.c:976
#4 0x00005625ce989d77 in on_quit (state=0x7fff330f1d40, retain_splash=<optimized out>,
    quit_trigger=0x5625cf4e9200) at main.c:1435
#5 0x00005625ce984dcc in ply_boot_connection_on_request (connection=0x5625cf4ee080)
    at ply-boot-server.c:529
#6 0x00007ff2a5624f26 in ply_event_loop_handle_met_status_for_source (status=<optimized out>,
    source=0x5625cf3fda90, loop=0x5625cf3793a0) at ply-event-loop.c:1034
#7 ply_event_loop_process_pending_events (loop=0x5625cf3793a0) at ply-event-loop.c:1279
#8 0x00007ff2a56253c0 in ply_event_loop_run (loop=0x5625cf3793a0) at ply-event-loop.c:1310
#9 0x00005625ce982565 in main (argc=<optimized out>, argv=0x7fff330f2f38) at main.c:2398
(gdb)
#0 0x00007ff2a56137f9 in ply_renderer_set_handler_for_input_source (renderer=<optimized out>,
    input_source=0x5625cf38ced0, handler=0x0, user_data=0x0) at ply-renderer.c:406
#1 0x00007ff2a560d5ac in ply_keyboard_stop_watching_for_renderer_input (keyboard=0x5625cf38dad0)
    at ply-keyboard.c:406
#2 ply_keyboard_stop_watching_for_input (keyboard=keyboard@entry=0x5625cf38dad0) at ply-keyboard.c:406
#3 0x00007ff2a560cb3b in ply_device_manager_deactivate_keyboards (manager=0x5625cf37ef70)
    at ply-device-manager.c:976
#4 0x00005625ce989d77 in on_quit (state=0x7fff330f1d40, retain_splash=<optimized out>,
    quit_trigger=0x5625cf4e9200) at main.c:1435
#5 0x00005625ce984dcc in ply_boot_connection_on_request (connection=0x5625cf4ee080)
    at ply-boot-server.c:529
#6 0x00007ff2a5624f26 in ply_event_loop_handle_met_status_for_source (status=<optimized out>,
    source=0x5625cf3fda90, loop=0x5625cf3793a0) at ply-event-loop.c:1034
#7 ply_event_loop_process_pending_events (loop=0x5625cf3793a0) at ply-event-loop.c:1279
#8 0x00007ff2a56253c0 in ply_event_loop_run (loop=0x5625cf3793a0) at ply-event-loop.c:1310
#9 0x00005625ce982565 in main (argc=<optimized out>, argv=0x7fff330f2f38) at main.c:2398
(gdb) f 1
#1 0x00007ff2a560d5ac in ply_keyboard_stop_watching_for_renderer_input (keyboard=0x5625cf38dad0)
    at ply-keyboard.c:406
406 ply-keyboard.c: No such file or directory.
(gdb) print keyboard
$4 = (ply_keyboard_t *) 0x5625cf38dad0
(gdb) print *keyboard
$5 = {loop = 0x5625cf3793a0, provider_type = PLY_KEYBOARD_PROVIDER_TYPE_RENDERER, provider = {
    if_renderer = 0x5625cf38fdf0, if_terminal = 0x5625cf38fdf0}, line_buffer = 0x5625cf38ed40,
  keyboard_input_handler_list = 0x5625cf38fd70, backspace_handler_list = 0x5625cf38fd90,
  escape_handler_list = 0x5625cf38fdb0, enter_handler_list = 0x5625cf38fdd0, is_active = 1}
(gdb) print keyboard->provider
$6 = {if_renderer = 0x5625cf38fdf0, if_terminal = 0x5625cf38fdf0}
(gdb) print keyboard->provider->if_renderer
$7 = (ply_keyboard_renderer_provider_t *) 0x5625cf38fdf0
(gdb) print *keyboard->provider->if_renderer
$8 = {renderer = 0x5625cf395d90, input_source = 0x5625cf38ced0}
(gdb) print *keyboard->provider->if_renderer->renderer
$9 = {loop = 0x5625cf395840, module_handle = 0x0, plugin_interface = 0x0, backend = 0x31,
  type = -816927760, device_name = 0x7ff2a55fecc0 <main_arena+128> "\260\354_\245\362\177",
  terminal = 0x5625cf4e87d0, input_source_is_open = 0, is_mapped = 0, is_active = 0}
(gdb) set $renderer = keyboard->provider->if_renderer->renderer
(gdb) print $renderer
$10 = (ply_renderer_t *) 0x5625cf395d90
(gdb) print *$renderer
$11 = {loop = 0x5625cf395840, module_handle = 0x0, plugin_interface = 0x0, backend = 0x31,
  type = -816927760, device_name = 0x7ff2a55fecc0 <main_arena+128> "\260\354_\245\362\177",
  terminal = 0x5625cf4e87d0, input_source_is_open = 0, is_mapped = 0, is_active = 0}
(gdb) print *$renderer->plugin_interface
Cannot access memory at address 0x0
(gdb) print $renderer->plugin_interface
$12 = (const ply_renderer_plugin_interface_t *) 0x0
(gdb) print *keyboard
$14 = {loop = 0x5625cf3793a0, provider_type = PLY_KEYBOARD_PROVIDER_TYPE_RENDERER, provider = {
    if_renderer = 0x5625cf38fdf0, if_terminal = 0x5625cf38fdf0}, line_buffer = 0x5625cf38ed40,
  keyboard_input_handler_list = 0x5625cf38fd70, backspace_handler_list = 0x5625cf38fd90,
  escape_handler_list = 0x5625cf38fdb0, enter_handler_list = 0x5625cf38fdd0, is_active = 1}
(gdb) print keyboard->provider_type
$15 = PLY_KEYBOARD_PROVIDER_TYPE_RENDERER
(gdb) print $renderer
$16 = (ply_renderer_t *) 0x5625cf395d90
(gdb) print $renderer->input_source_is_open
$17 = 0
(gdb) print $renderer->is_active
$18 = 0
(gdb) print $renderer->is_mapped
$19 = 0