Merge pull request #926 from emersion/fix-x11-backend-memory-leaks

Fix some backend memory leaks
This commit is contained in:
Drew DeVault 2018-04-29 08:00:59 -04:00 committed by GitHub
commit a0f4903063
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 66 additions and 38 deletions

View file

@ -77,6 +77,8 @@ struct wlr_x11_output *get_x11_output_from_window_id(struct wlr_x11_backend *x11
void get_x11_output_layout_box(struct wlr_x11_backend *backend,
struct wlr_box *box);
extern const struct wlr_keyboard_impl keyboard_impl;
extern const struct wlr_pointer_impl pointer_impl;
extern const struct wlr_input_device_impl input_device_impl;
void handle_x11_input_event(struct wlr_x11_backend *x11,

View file

@ -9,7 +9,8 @@ struct wlr_keyboard_impl {
void (*led_update)(struct wlr_keyboard *keyboard, uint32_t leds);
};
void wlr_keyboard_init(struct wlr_keyboard *keyboard, struct wlr_keyboard_impl *impl);
void wlr_keyboard_init(struct wlr_keyboard *keyboard,
const struct wlr_keyboard_impl *impl);
void wlr_keyboard_destroy(struct wlr_keyboard *keyboard);
void wlr_keyboard_notify_key(struct wlr_keyboard *keyboard,
struct wlr_event_keyboard_key *event);

View file

@ -8,7 +8,7 @@ struct wlr_pointer_impl {
};
void wlr_pointer_init(struct wlr_pointer *pointer,
struct wlr_pointer_impl *impl);
const struct wlr_pointer_impl *impl);
void wlr_pointer_destroy(struct wlr_pointer *pointer);
#endif

View file

@ -40,8 +40,7 @@ struct wlr_keyboard_modifiers {
};
struct wlr_keyboard {
struct wlr_keyboard_impl *impl;
// TODO: Should this store key repeat info too?
const struct wlr_keyboard_impl *impl;
int keymap_fd;
size_t keymap_size;

View file

@ -8,7 +8,7 @@
struct wlr_pointer_impl;
struct wlr_pointer {
struct wlr_pointer_impl *impl;
const struct wlr_pointer_impl *impl;
struct {
struct wl_signal motion;