xwayland: Add code to cleanup xwayland on shutdown
authorChris Michael <cp.michael@samsung.com>
Mon, 8 Sep 2014 16:30:34 +0000 (12:30 -0400)
committerMike Blumenkrantz <zmike@osg.samsung.com>
Fri, 26 Jun 2015 00:04:30 +0000 (20:04 -0400)
Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/modules/xwayland/e_mod_main.c

index f1f6144..0f887f7 100644 (file)
@@ -229,6 +229,8 @@ fail:
         close(wms[1]);
         exs->wm_fd = wms[0];
 
+        /* TODO: watch process ?? */
+
         if (exs->abs_hdlr)
           ecore_main_fd_handler_del(exs->abs_hdlr);
         if (exs->unx_hdlr)
@@ -354,5 +356,24 @@ lock:
 EAPI int 
 e_modapi_shutdown(E_Module *m EINA_UNUSED)
 {
+   char path[256];
+
+   if (!exs) return 1;
+
+   unlink(exs->lock);
+
+   snprintf(path, sizeof(path), "/tmp/.X11-unix/X%d", exs->disp);
+   unlink(path);
+
+   if (exs->abs_hdlr) ecore_main_fd_handler_del(exs->abs_hdlr);
+   if (exs->unx_hdlr) ecore_main_fd_handler_del(exs->unx_hdlr);
+
+   close(exs->abs_fd);
+   close(exs->unx_fd);
+
+   if (exs->sig_hdlr) ecore_event_handler_del(exs->sig_hdlr);
+
+   free(exs);
+
    return 1;
 }