Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
}
registry::registry(struct wl_display *d)
- : wayland_proxy(wl_display_get_registry(d)) {
- wl_registry_add_listener(this->proxy, ®istry_listener, this);
+ : wayland_proxy(!d ? nullptr : wl_display_get_registry(d)) {
+ if (this->proxy)
+ wl_registry_add_listener(this->proxy, ®istry_listener, this);
}
registry::~registry() {
// 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));
}
}
};