aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-06-19 13:52:10 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commit648cc13845c4bb212460e4960896a0541e5b8b59 (patch)
treefec9957989a0a443bf2a634bc05159ccd77b8ea4 /src
parent7c36569cc56a5d82bfe2d501ced76ff3a0a3af7b (diff)
wayland: minor fix with this-> and formatting
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src')
-rw-r--r--src/wayland.cpp5
-rw-r--r--src/wayland.hpp2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/wayland.cpp b/src/wayland.cpp
index c19b0dc..b4f4800 100644
--- a/src/wayland.cpp
+++ b/src/wayland.cpp
@@ -53,8 +53,9 @@ constexpr struct wl_registry_listener registry_listener = {
}
registry::registry(struct wl_display *d)
- : wayland_proxy(wl_display_get_registry(d)) {
- wl_registry_add_listener(this->proxy, &registry_listener, this);
+ : wayland_proxy(!d ? nullptr : wl_display_get_registry(d)) {
+ if (this->proxy)
+ wl_registry_add_listener(this->proxy, &registry_listener, this);
}
registry::~registry() {
diff --git a/src/wayland.hpp b/src/wayland.hpp
index c97c51a..afebe92 100644
--- a/src/wayland.hpp
+++ b/src/wayland.hpp
@@ -27,7 +27,7 @@ struct wayland_proxy {
// custom wayland dtor
if (this->proxy) {
logdebug("%s %p @ %p", __func__, this, this->proxy);
- wl_proxy_destroy(reinterpret_cast<struct wl_proxy *>(proxy));
+ wl_proxy_destroy(reinterpret_cast<struct wl_proxy *>(this->proxy));
}
}
};