CuarzoSoftware / Louvre

C++ library for building Wayland compositors.
MIT License
506 stars 14 forks source link

Use std::unique_ptr for object alive indicator #36

Closed Paraworker closed 6 months ago

Paraworker commented 6 months ago

Manage resources in a RAII way

ehopperdietzel commented 6 months ago

Hi, thank you! I'll merge it in the next release, btw you made me realize that using a shared pointer would fit better for this case, as we could remove the aux vector and functions from LCompositor.

Paraworker commented 6 months ago

Actually I'm doing the shared pointer stuff, but found a crash when launching weston-terminal in louvre-views, it's a little wired for me now since this is the first day I read the source code. I can transform this PR into shared pointer if you could continue fixing that.

ehopperdietzel commented 6 months ago

No worries, I merged your changes to the 2.0.0 branch and hacked it a bit to use shared_ptr, but please don't try that branch, I am changing the entire input event system so its pretty messy right now