Index: app/remote-x11.c
===================================================================
--- app/remote-x11.c	(revision 10360)
+++ app/remote-x11.c	(revision 10361)
@@ -132,6 +132,10 @@
     }
 
     XFree(xchildren);
+    if (!remote->winid) {
+        gwy_remote_free(remote);
+        remote = NULL;
+    }
 
     return remote;
 }
