fixed #1620: Invoking localStorageFree in the destructor of ScriptingCore. Added header file to cocos-ext.h

This commit is contained in:
James Chen 2013-01-07 17:34:22 +08:00
parent 3fa771f0c4
commit 1d59a36ee9
2 changed files with 13 additions and 9 deletions

View File

@ -41,16 +41,18 @@
#include "network/HttpResponse.h"
#include "network/HttpClient.h"
// Physics integration
#if CC_ENABLE_CHIPMUNK_INTEGRATION
#include "physics_nodes/CCPhysicsDebugNode.h"
#include "physics_nodes/CCPhysicsSprite.h"
#endif
#if CC_ENABLE_BOX2D_INTEGRATION
#include "physics_nodes/CCPhysicsDebugNode.h"
#include "physics_nodes/CCPhysicsSprite.h"
// Physics integration
#if CC_ENABLE_CHIPMUNK_INTEGRATION
#include "physics_nodes/CCPhysicsDebugNode.h"
#include "physics_nodes/CCPhysicsSprite.h"
#endif
#if CC_ENABLE_BOX2D_INTEGRATION
#include "physics_nodes/CCPhysicsDebugNode.h"
#include "physics_nodes/CCPhysicsSprite.h"
#endif
#include "LocalStorage/LocalStorage.h"
#endif /* __COCOS2D_EXT_H__ */

View File

@ -16,6 +16,7 @@
#include "ScriptingCore.h"
#include "jsdbgapi.h"
#include "cocos2d.h"
#include "cocos-ext.h"
#include "cocos2d_specifics.hpp"
// for debug socket
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
@ -465,6 +466,7 @@ JSBool ScriptingCore::runScript(const char *path, JSObject* global, JSContext* c
ScriptingCore::~ScriptingCore()
{
localStorageFree();
removeAllRoots(cx_);
JS_DestroyContext(cx_);
JS_DestroyRuntime(rt_);