-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix memory leaks #9
Conversation
main.c
Outdated
@@ -144,6 +145,8 @@ static void seat_handle_capabilities(void *data, struct wl_seat *seat, | |||
struct wl_pointer *wl_pointer = wl_seat_get_pointer(seat); | |||
create_pointer(state, wl_pointer); | |||
} | |||
|
|||
wl_seat_destroy(seat); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I don't think we can do this. This function is called whenever seat capabilities change, this can happen at runtime (when you hotplug a mouse/keyboard for instance).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, my bad. Maybe keep a reference of it in the state and destroy it on exit then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no guarantee that there will be only one seat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A list then? Or do you just want to leave it for now? I can remove the line from my patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, a list with all the burden that comes with it: adding a new struct and allocating list elements.
This can be done in another PR if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Splitting it into another PR sounds like a good idea to me.
Thanks! |
No description provided.