Invoking WebSocket::closeAllConnection while reseting Director.

This commit is contained in:
James Chen 2016-01-09 18:08:26 +08:00
parent d122784ad4
commit 763559cd1e
1 changed files with 4 additions and 0 deletions

View File

@ -61,6 +61,7 @@ THE SOFTWARE.
#include "base/CCConfiguration.h"
#include "base/CCAsyncTaskPool.h"
#include "platform/CCApplication.h"
#include "network/WebSocket.h"
#if CC_ENABLE_SCRIPT_BINDING
#include "CCScriptSupport.h"
@ -930,6 +931,9 @@ void Director::reset()
_runningScene = nullptr;
_nextScene = nullptr;
// Close all websocket connection. It has to be invoked before cleaning scheduler
network::WebSocket::closeAllConnections();
// cleanup scheduler
getScheduler()->unscheduleAll();