cs: fix allocator aborts

This commit is contained in:
Michael Scire 2021-07-27 23:55:53 -07:00 committed by SciresM
parent ebb0bd2b41
commit 8acf0a4fa9
4 changed files with 51 additions and 7 deletions

View file

@ -84,11 +84,17 @@ namespace ams::pgl {
class EventObserver {
NON_COPYABLE(EventObserver);
private:
std::unique_ptr<impl::EventObserverInterface> m_impl;
struct Deleter {
void operator()(impl::EventObserverInterface *);
};
public:
using UniquePtr = std::unique_ptr<impl::EventObserverInterface, Deleter>;
private:
UniquePtr m_impl;
public:
EventObserver() { /* ... */ }
explicit EventObserver(std::unique_ptr<impl::EventObserverInterface> impl) : m_impl(std::move(impl)) { /* ... */ }
explicit EventObserver(UniquePtr impl) : m_impl(std::move(impl)) { /* ... */ }
EventObserver(EventObserver &&rhs) {
m_impl = std::move(rhs.m_impl);