<p dir="ltr">Looks like a good idea to me.<br>
--Jason</p>
<div class="gmail_quote">On Dec 20, 2013 1:07 PM, "Ander Conselvan de Oliveira" <<a href="mailto:conselvan2@gmail.com">conselvan2@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Ander Conselvan de Oliveira <<a href="mailto:ander.conselvan.de.oliveira@intel.com">ander.conselvan.de.oliveira@intel.com</a>><br>
<br>
Set the internal pointer for the client to NULL. This fixes a<br>
segmentation fault at shutdown, where the shell would hang up before<br>
and cause libwayland to call wl_client_destroy(). When the shell was<br>
destroyed later, another call to wl_client_destroy() would cause the<br>
crash.<br>
<br>
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=72550" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=72550</a><br>
---<br>
desktop-shell/shell.c | 16 ++++++++++++++++<br>
desktop-shell/shell.h | 1 +<br>
2 files changed, 17 insertions(+)<br>
<br>
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c<br>
index 3d586ec..714881b 100644<br>
--- a/desktop-shell/shell.c<br>
+++ b/desktop-shell/shell.c<br>
@@ -5008,6 +5008,17 @@ desktop_shell_sigchld(struct weston_process *process, int status)<br>
}<br>
<br>
static void<br>
+desktop_shell_client_destroy(struct wl_listener *listener, void *data)<br>
+{<br>
+ struct desktop_shell *shell;<br>
+<br>
+ shell = container_of(listener, struct desktop_shell,<br>
+ child.client_destroy_listener);<br>
+<br>
+ shell->child.client = NULL;<br>
+}<br>
+<br>
+static void<br>
launch_desktop_shell_process(void *data)<br>
{<br>
struct desktop_shell *shell = data;<br>
@@ -5019,6 +5030,11 @@ launch_desktop_shell_process(void *data)<br>
<br>
if (!shell->child.client)<br>
weston_log("not able to start %s\n", shell->client);<br>
+<br>
+ shell->child.client_destroy_listener.notify =<br>
+ desktop_shell_client_destroy;<br>
+ wl_client_add_destroy_listener(shell->child.client,<br>
+ &shell->child.client_destroy_listener);<br>
}<br>
<br>
static void<br>
diff --git a/desktop-shell/shell.h b/desktop-shell/shell.h<br>
index d7c34fc..7a8194d 100644<br>
--- a/desktop-shell/shell.h<br>
+++ b/desktop-shell/shell.h<br>
@@ -92,6 +92,7 @@ struct desktop_shell {<br>
struct weston_process process;<br>
struct wl_client *client;<br>
struct wl_resource *desktop_shell;<br>
+ struct wl_listener client_destroy_listener;<br>
<br>
unsigned deathcount;<br>
uint32_t deathstamp;<br>
--<br>
1.7.9.5<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</blockquote></div>