fix onConnect not being called if there are no clients

This commit is contained in:
Me No Dev 2016-06-29 20:50:00 +03:00
parent 0d02922e52
commit a5674fab69
1 changed files with 2 additions and 0 deletions

View File

@ -182,6 +182,8 @@ void AsyncEventSource::onConnect(ArEventHandlerFunction cb){
void AsyncEventSource::_addClient(AsyncEventSourceClient * client){
if(_clients == NULL){
_clients = client;
if(_connectcb)
_connectcb(client);
return;
}
AsyncEventSourceClient * c = _clients;