From 9b439d3d808ec0c0a904808ebbe7a6dda1e4d8a5 Mon Sep 17 00:00:00 2001 From: sidorares Date: Fri, 9 Sep 2011 11:27:17 +1000 Subject: [PATCH] save reference to client before emitting connect event --- lib/x11/xcore.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/x11/xcore.js b/lib/x11/xcore.js index 648a83e..61f4f81 100644 --- a/lib/x11/xcore.js +++ b/lib/x11/xcore.js @@ -302,6 +302,7 @@ XClient.prototype.startHandshake = function() // emit error in that case client.expectReplyHeader(); client.display = display; + display.client = client; client.emit('connect', display); }); } @@ -351,7 +352,6 @@ module.exports.createClient = function(initCb, display) if (initCb) { client.on('connect', function(display) { - display.client = client; initCb(display); }); }