Index: uspace/srv/hid/display/client.c
===================================================================
--- uspace/srv/hid/display/client.c	(revision dcac7562e88fee6f40fa87e059eccac68a5eb941)
+++ uspace/srv/hid/display/client.c	(revision ecb7828095d2afcbe676486fada5cd94b53906da)
@@ -75,4 +75,12 @@
 void ds_client_destroy(ds_client_t *client)
 {
+	ds_window_t *window;
+
+	window = ds_client_first_window(client);
+	while (window != NULL) {
+		ds_window_destroy(window);
+		window = ds_client_first_window(client);
+	}
+
 	assert(list_empty(&client->windows));
 	ds_display_remove_client(client);
Index: uspace/srv/hid/display/test/client.c
===================================================================
--- uspace/srv/hid/display/test/client.c	(revision dcac7562e88fee6f40fa87e059eccac68a5eb941)
+++ uspace/srv/hid/display/test/client.c	(revision ecb7828095d2afcbe676486fada5cd94b53906da)
@@ -203,3 +203,28 @@
 }
 
+/** Test client being destroyed while still having a window.
+ *
+ * This can happen if client forgets to destroy window or if the client
+ * is disconnected (or terminated).
+ */
+PCUT_TEST(client_leftover_window)
+{
+	ds_display_t *disp;
+	ds_client_t *client;
+	ds_window_t *wnd;
+	errno_t rc;
+
+	rc = ds_display_create(NULL, &disp);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ds_client_create(disp, NULL, NULL, &client);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	rc = ds_window_create(client, &wnd);
+	PCUT_ASSERT_ERRNO_VAL(EOK, rc);
+
+	ds_client_destroy(client);
+	ds_display_destroy(disp);
+}
+
 PCUT_EXPORT(client);
Index: uspace/srv/hid/display/window.c
===================================================================
--- uspace/srv/hid/display/window.c	(revision dcac7562e88fee6f40fa87e059eccac68a5eb941)
+++ uspace/srv/hid/display/window.c	(revision ecb7828095d2afcbe676486fada5cd94b53906da)
@@ -220,16 +220,10 @@
  * @param wnd Window GC
  */
-errno_t ds_window_destroy(ds_window_t *wnd)
-{
-	errno_t rc;
-
+void ds_window_destroy(ds_window_t *wnd)
+{
 	ds_client_remove_window(wnd);
-
-	rc = gfx_context_delete(wnd->gc);
-	if (rc != EOK)
-		return rc;
+	(void) gfx_context_delete(wnd->gc);
 
 	free(wnd);
-	return EOK;
 }
 
Index: uspace/srv/hid/display/window.h
===================================================================
--- uspace/srv/hid/display/window.h	(revision dcac7562e88fee6f40fa87e059eccac68a5eb941)
+++ uspace/srv/hid/display/window.h	(revision ecb7828095d2afcbe676486fada5cd94b53906da)
@@ -47,5 +47,5 @@
 
 extern errno_t ds_window_create(ds_client_t *, ds_window_t **);
-extern errno_t ds_window_destroy(ds_window_t *);
+extern void ds_window_destroy(ds_window_t *);
 extern gfx_context_t *ds_window_get_ctx(ds_window_t *);
 
