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

add a destructor to CHyprOpenglImpl and avoid wl_container_of undefined behaviour #7101

Merged
merged 2 commits into from
Jul 29, 2024

Conversation

gulafaran
Copy link
Contributor

add a destructor to CHyprOpenglImpl to free allocated memory/fd/etc to make asan more happy on destruction.

to safely use wl_container_of with a class the class has to be no virtual functions, no inheritance, and uniform access control (e.g all public)

work around this by putting this into a destroywrapper struct.

@vaxerski
Copy link
Member

tiv1 is being rewritten #7096 can you drop the changes there

@gulafaran
Copy link
Contributor Author

tiv1 is being rewritten #7096 can you drop the changes there

oh i see, sure

@gulafaran
Copy link
Contributor Author

tiv1 is being rewritten #7096 can you drop the changes there

oh i see, sure

fixed my love.

@gulafaran
Copy link
Contributor Author

want me to add the missing include to protocols/VirtualPointer.hpp to fix non precompiled header builds?

#include "../helpers/Monitor.hpp"

@vaxerski
Copy link
Member

rebase on main

to safely use wl_container_of with a class the class has to be no
virtual functions, no inheritance, and uniform access control (e.g all
public)

work around this by putting this into a destroywrapper struct.
add a destructor and free the allocated memory and close the fd
@gulafaran
Copy link
Contributor Author

rebase on main

rebased, now CI is happy :>

@vaxerski vaxerski merged commit 0b4760b into hyprwm:main Jul 29, 2024
10 checks passed
vaxerski pushed a commit that referenced this pull request Jul 29, 2024
…ndefined behaviour (#7101)

* protocols: avoid undefined behaviour in C macro

to safely use wl_container_of with a class the class has to be no
virtual functions, no inheritance, and uniform access control (e.g all
public)

work around this by putting this into a destroywrapper struct.

* opengl: clean memory on destruction

add a destructor and free the allocated memory and close the fd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants