aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-06-26 13:20:05 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commit0f8562c512b461f24ef2ea9e61bdc20a1ef602f0 (patch)
tree7fc865adf15318d96fdc15e1b5a746fde5b692d9 /src
parentdc465727c14a7d7588dad8554afc08f55e769b76 (diff)
wayland: display unique_ptr holds a void(*)(...) deleter
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src')
-rw-r--r--src/wayland.cpp10
-rw-r--r--src/wayland.hpp3
2 files changed, 8 insertions, 5 deletions
diff --git a/src/wayland.cpp b/src/wayland.cpp
index 2bae9e8..950335a 100644
--- a/src/wayland.cpp
+++ b/src/wayland.cpp
@@ -15,14 +15,18 @@ namespace wl {
// \__,_|_|___/ .__/|_|\__,_|\__, |
// |_| |___/
display::display()
- : d(std::unique_ptr<struct wl_display,
- std::function<void(struct wl_display *)>>(
+ : d(std::unique_ptr<struct wl_display, void (*)(struct wl_display *)>(
wl_display_connect(NULL),
+#ifdef DEBUG_OUTPUT
[](struct wl_display *d) {
logdebug("wl::display ~display @ %p", d);
wl_display_disconnect(d);
})),
- r(d.get()) {}
+#else
+ &wl_display_disconnect)),
+#endif
+ r(d.get()) {
+}
display::~display() {}
diff --git a/src/wayland.hpp b/src/wayland.hpp
index ba1effd..7ff1145 100644
--- a/src/wayland.hpp
+++ b/src/wayland.hpp
@@ -66,8 +66,7 @@ struct registry : public wayland_proxy<struct wl_registry> {
// \__,_|_|___/ .__/|_|\__,_|\__, |
// |_| |___/
struct display {
- std::unique_ptr<struct wl_display, std::function<void(struct wl_display *)>>
- d;
+ std::unique_ptr<struct wl_display, void(*)(struct wl_display *)> d;
struct registry r;
display();