<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 7, 2015 at 12:42 AM, Marek Chalupa <span dir="ltr"><<a href="mailto:mchqwerty@gmail.com" target="_blank">mchqwerty@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
diff --git a/src/wayland-server.c b/src/wayland-server.c<br>
index 1364d5d..b372aa9 100644<br>
--- a/src/wayland-server.c<br>
+++ b/src/wayland-server.c<br>
@@ -511,6 +511,14 @@ wl_client_get_object(struct wl_client *client, uint32_t id)<br>
 WL_EXPORT void<br>
 wl_client_post_no_memory(struct wl_client *client)<br>
 {<br>
+       /* display_resource is destroyed first upon client's destruction<br>
+        * If some resource destructor calls wl_client_post_no_memory()<br>
+        * (why it would do it? you never know...), we would pass NULL<br>
+        * here as a resource to the wl_resource_post_error<br>
+        * and we don't want that */<br>
+       if (!client->display_resource)<br>
+               return;<br>
+<br>
        wl_resource_post_error(client->display_resource,<br>
                               WL_DISPLAY_ERROR_NO_MEMORY, "no memory");<br>
 }<br>
@@ -779,7 +787,8 @@ bind_display(struct wl_client *client, struct wl_display *display)<br>
        client->display_resource =<br>
                wl_resource_create(client, &wl_display_interface, 1, 1);<br>
        if (client->display_resource == NULL) {<br>
-               wl_client_post_no_memory(client);<br>
+               /* Don't send error to client -<br>
+                * what resource we would use anyway? */<br>
                return -1;<br>
        }<br>
<span class="HOEnZb"></span></blockquote><div><br></div><div>Seems like you put two fixes in this, one of them is redundant. My guess is that you want the second change and not the first, but I'm not really certain about it.<br><br>Also it is inconsistent about using !x v.s. x==NULL.<br><br><br> <br></div></div></div></div>