Skip to content
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

refactor(client): use std::list<waybar_output> to store outputs #555

Merged
merged 1 commit into from
Jan 15, 2020

Conversation

alebastr
Copy link
Contributor

std::unique_ptr is not required here as the only benefit it gives is stability of address on vector resize and it's easy to invalidate it accidentally. std::list provides the same guarantee of stable addresses
of the elements and correct destruction while avoiding smart pointer overhead.

Also fixes #554, caused by my inability to read the manual for std::remove_if 😄

To be honest, fixing remove_if would be enough, but I already did the refactoring part and decided to proceed with that.

std::unique_ptr is not required here as the only benefit it gives is
stability of address on vector resize and it's easy to invalidate it
accidentaly. std::list provides the same guarantee of stable addresses
of the elements and correct destruction while avoiding smart pointer
overhead.

Also fixes Alexays#554, caused by incorrect usage of std::remove_if.
@jameswalmsley
Copy link

Have tested this on my machine. Works great. Will continue testing for the rest
of the week.

J

@Alexays Alexays merged commit 9e877d3 into Alexays:master Jan 15, 2020
@alebastr alebastr deleted the outputs-remove-unique_ptr branch January 15, 2020 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SIGSEGV on Monitor Disconnect/Connect
3 participants