void SDL_EVDEV_Quit(void) { if (_this == NULL) { return; } _this->ref_count -= 1; if (_this->ref_count < 1) { #if SDL_USE_LIBUDEV SDL_UDEV_DelCallback(SDL_EVDEV_udev_callback); SDL_UDEV_Quit(); #endif /* SDL_USE_LIBUDEV */ if (_this->console_fd >= 0) { SDL_EVDEV_unmute_keyboard(_this->console_fd, _this->kb_mode); close(_this->console_fd); } /* Remove existing devices */ while(_this->first != NULL) { SDL_EVDEV_device_removed(_this->first->path); } SDL_assert(_this->first == NULL); SDL_assert(_this->last == NULL); SDL_assert(_this->num_devices == 0); SDL_free(_this); _this = NULL; } }
void SDL_EVDEV_Quit(void) { if (_this == NULL) { return; } _this->ref_count -= 1; if (_this->ref_count < 1) { #if SDL_USE_LIBUDEV SDL_UDEV_DelCallback(SDL_EVDEV_udev_callback); SDL_UDEV_Quit(); #endif /* SDL_USE_LIBUDEV */ SDL_EVDEV_kbd_quit(_this->kbd); /* Remove existing devices */ while(_this->first != NULL) { SDL_EVDEV_device_removed(_this->first->path); } SDL_assert(_this->first == NULL); SDL_assert(_this->last == NULL); SDL_assert(_this->num_devices == 0); SDL_free(_this); _this = NULL; } }