save reference to client before emitting connect event

This commit is contained in:
sidorares 2011-09-09 11:27:17 +10:00
parent f41ec2f635
commit 9b439d3d80

View file

@ -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);
});
}