mirror of
				https://gitlab.freedesktop.org/wlroots/wlroots.git
				synced 2025-11-03 09:01:40 -05:00 
			
		
		
		
	Use libinput_event_destroy/xkb_*_unref
Also sneak in a missing drmModeFreePlaneResources
This commit is contained in:
		
							parent
							
								
									e1293a7853
								
							
						
					
					
						commit
						de86965174
					
				
					 3 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -104,6 +104,7 @@ static bool init_planes(struct wlr_backend_state *drm) {
 | 
				
			||||||
	drm->primary_planes = drm->overlay_planes + drm->num_overlay_planes;
 | 
						drm->primary_planes = drm->overlay_planes + drm->num_overlay_planes;
 | 
				
			||||||
	drm->cursor_planes = drm->primary_planes + drm->num_primary_planes;
 | 
						drm->cursor_planes = drm->primary_planes + drm->num_primary_planes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						drmModeFreePlaneResources(plane_res);
 | 
				
			||||||
	return true;
 | 
						return true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
error_planes:
 | 
					error_planes:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,6 +33,7 @@ static int wlr_libinput_readable(int fd, uint32_t mask, void *_state) {
 | 
				
			||||||
	struct libinput_event *event;
 | 
						struct libinput_event *event;
 | 
				
			||||||
	while ((event = libinput_get_event(state->libinput))) {
 | 
						while ((event = libinput_get_event(state->libinput))) {
 | 
				
			||||||
		wlr_libinput_event(state, event);
 | 
							wlr_libinput_event(state, event);
 | 
				
			||||||
 | 
							libinput_event_destroy(event);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -311,6 +311,8 @@ static void keyboard_remove(struct wlr_input_device *device, struct compositor_s
 | 
				
			||||||
	if (!kbstate) {
 | 
						if (!kbstate) {
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						xkb_state_unref(kbstate->xkb_state);
 | 
				
			||||||
 | 
						xkb_map_unref(kbstate->keymap);
 | 
				
			||||||
	wl_list_remove(&kbstate->link);
 | 
						wl_list_remove(&kbstate->link);
 | 
				
			||||||
	wl_list_remove(&kbstate->key.link);
 | 
						wl_list_remove(&kbstate->key.link);
 | 
				
			||||||
	free(kbstate);
 | 
						free(kbstate);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue