Commit Graph

2517 Commits

Author SHA1 Message Date
Ricardo Quesada be64dd97cf replaces `delete[]` with `free()` in C-based API
API that returns a newly allocated buffer as an output argument (not return value) are error-prone.

- Users forget to release the newly allocated buffer
- Or the call `delete` instead of `delete[]`

But some of those API need to call `realloc` on the buffer.
But `realloc` is only valid if the buffer was previously allocated with `malloc`.
If a buffer needs to be re-allocated using a C++ API, then `std::vector<char*>` should be used instead...

So, this patch does:

- Migrates the API from  `new []` / `delete[]` to  `malloc()` / `free()`
- Fixes all the memory issues: incorrect deallocs and memory leaks
- Updates the documentation
- And fixes misc issues with the API: removes `cc` from the ZipUtils class.
2013-11-11 18:09:47 -08:00
CocosRobot 3472d7ad50 [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-11 10:57:57 +00:00
minggo b868c3f1dc Merge pull request #4173 from minggo/remove-makefile
[ci skip]remove makefiles
2013-11-11 02:19:16 -08:00
minggo 1e15071dc7 remove makefiles 2013-11-11 17:29:48 +08:00
samuele3 7cfe890d5d Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into developCCS 2013-11-11 17:04:37 +08:00
samuele3 06c7d3e96d issue #2868:Add ccd lua test samples 2013-11-11 17:03:43 +08:00
James Chen 49289d7576 Adding cc.TextureCache.getInstance() to jsb_deprecated.js. 2013-11-11 16:45:44 +08:00
James Chen 20b350a58b Removing cocosjs_manual_conversions.h(.cpp). Put all jsval <-> native value conversion codes to js_manual_conversions.h(.cpp). 2013-11-11 16:45:44 +08:00
CocosRobot 2e52dd4905 [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-11 08:05:15 +00:00
James Chen 9d7a8c44f9 Reverts auto-generated. 2013-11-11 14:40:23 +08:00
James Chen 8f8d0f86d7 Updating Bindings-generator. 2013-11-11 14:38:12 +08:00
James Chen ff3bfbe8a2 Using std::unordered_map instead of UTHASH for js_type_class_t.
Since xxx.hash_code() return size_t which is 8bytes on 64bit system, we should not use HASH_ADD_INT and HASH_FIND_INT for js_type_class_t.
2013-11-11 14:36:43 +08:00
James Chen 5a0df8d2e8 VS2012 doesn’t support invoke another constructor method in current constructor. 2013-11-11 14:36:43 +08:00
James Chen fe88f7c941 Fixing memory leak of JSStringWrapper::set . 2013-11-11 14:36:43 +08:00
James Chen 9d5813b7d9 Some fixes:
1) Moving the implementation of JSStringWrapper to .cpp file. Removing override operator() which will be easy to make errors.
2) Deleting JSCallFuncWrapper since it isn’t needed after using std::function for MenuItem’s Callback.
3) Fixing ChipmunkTest crash sometimes on MAC platform(64bit).
2013-11-11 14:36:42 +08:00
James Chen 0c4b6e7a37 Removing JSB Version since JSB source codes will be updated with cocos2d-x.
Also, remove some unused codes.
2013-11-11 10:40:51 +08:00
minggo 9a3d2e941e Merge pull request #3969 from dualface/develop
[ci skip]fix tolua_fix, cleanup peertable after object deleted
2013-11-10 17:44:24 -08:00
dualface c75c20de04 fix Lua 5.2 compatibility 2013-11-10 11:49:52 +08:00
CocosRobot 6e6c63e111 [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-10 03:29:03 +00:00
samuele3 d4dbc7a442 Add conversion config for long type 2013-11-10 09:21:33 +08:00
dualface 2a2fc81f86 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into develop 2013-11-10 00:00:19 +08:00
samuele3 e26fe04deb Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into developCCS 2013-11-09 23:04:11 +08:00
samuele3 286393d28e issue #2868:Add more manual lua binding functions 2013-11-09 22:58:40 +08:00
Ricardo Quesada 5faae4a51e removes exe bit from text files 2013-11-08 11:30:50 -08:00
CocosRobot fd37d3e973 [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-08 04:17:15 +00:00
CocosRobot 240fc2ade1 [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-08 03:10:36 +00:00
samuele3 f56269ce85 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into developCCS 2013-11-07 23:23:11 +08:00
samuele3 16d572c04f issue #2868:Add manual lua binding files 2013-11-07 23:22:11 +08:00
CocosRobot a116e7ec79 [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-07 09:11:22 +00:00
samuele3 8c025a2cee Reslove the linux compiled error 2013-11-07 15:12:19 +08:00
James Chen d6d041f561 issue #3113: [Linux] Adding options for modules. 2013-11-06 19:17:34 +08:00
CocosRobot 8a836dc477 [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-06 09:38:34 +00:00
CocosRobot d990699417 [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-06 08:00:35 +00:00
James Chen 9d3716e964 Merge pull request #4109 from HoGarfield/JS_Call
Missing add "JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET " before calling JS_CallFunctionValue
2013-11-05 23:56:03 -08:00
garfield_ho f36fd002cd Remove duplicate 2013-11-06 15:40:23 +08:00
garfield_ho f6070406cd Missing add "JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET " before calling JS_CallFunctionValue 2013-11-06 15:31:58 +08:00
James Chen 2e80e95a37 [Linux] compilation fix for PR #4099 2013-11-06 15:26:33 +08:00
James Chen 4e4798fdcc Merge commit 'refs/pull/4099/head' of https://github.com/cocos2d/cocos2d-x into 64bit-fix 2013-11-06 15:15:47 +08:00
CocosRobot d7ed908818 [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-06 06:20:17 +00:00
Ricardo Quesada 84a6aa29cd Adds more 64-bit fixes
Replaces more `int` with `long` where it makes sense.

Also , it repalces some `unsigned long` with `long` for "lenght"
values as described in our c++ guideline
2013-11-05 17:36:44 -08:00
CocosRobot 47e0d343ff [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-05 11:30:43 +00:00
James Chen 64b9cba5d5 Merge pull request #4092 from samuele3hu/developCCS
issue 2868:Move armature related lua binding from namespace 'cc' to namespace 'ccs'
2013-11-05 03:24:20 -08:00
samuele3 66256e9ad7 issue #2868:Move armature related lua binding from namespace 'cc' to namespace 'ccs' 2013-11-05 17:48:29 +08:00
samuele3 61d8f9673c issue #2868:Move armature related lua binding from namespace 'cc' to namespace 'ccd' 2013-11-05 17:34:25 +08:00
CocosRobot 8c75cd0dfa [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-05 08:07:15 +00:00
samuele3 b76865c692 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into developCCS 2013-11-05 15:11:05 +08:00
samuele3 b445f0824a issue #2868:Bind UI and Scene parser to lua by bindings-generator and add releated test samples 2013-11-05 15:09:51 +08:00
CocosRobot 5cecc93c3e [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-05 06:31:26 +00:00
James Chen daa91ad413 [CMake] Update library dependency. 2013-11-04 21:03:07 +08:00
James Chen c085412636 [CMake] TestLua and HelloLua is ok. 2013-11-04 21:03:07 +08:00
CocosRobot 1cf0a926e1 [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-04 02:46:22 +00:00
CocosRobot 6360c40725 [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-01 13:03:20 +00:00
CocosRobot a272bcd6ea [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-01 10:02:54 +00:00
samuele3 80f3a7d57a Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into developAssetsManager
Conflicts:
	build/cocos2d_samples.xcodeproj/project.pbxproj
	cocos/scripting/lua/bindings/LuaScriptHandlerMgr.h
	cocos/scripting/lua/script/Cocos2dConstants.lua
2013-11-01 17:17:21 +08:00
CocosRobot 8aac938531 [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-01 07:42:11 +00:00
CocosRobot 6eb6809b2c [AUTO] : updating submodule reference to latest autogenerated bindings 2013-11-01 06:52:31 +00:00
James Chen db6bce4cf0 Merge pull request #4023 from samuele3hu/developHttp
issue #3049:Add XMLHttpRequest lua binding and corresponding test sample
2013-10-31 20:40:29 -07:00
James Chen 3a8c052ae5 Merge pull request #4039 from dumganhar/spv25
issue #2826: Bug fix of 'js::IsInRequest'
2013-10-31 19:56:09 -07:00
James Chen baccf828f3 closed #2826: Removing js::IsInRequest in ScriptingCore.cpp for win32. 2013-11-01 10:45:01 +08:00
James Chen 074f688d95 Merge pull request #4030 from dumganhar/spv25
[sp v25] Updating SpiderMonkey library to FFv25.
2013-10-31 07:08:09 -07:00
samuelhu 4031556398 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into developHttp
Conflicts:
	build/cocos2d_samples.xcodeproj/project.pbxproj
	samples/Lua/TestLua/Resources/luaScript/mainMenu.lua
2013-10-31 21:57:24 +08:00
samuelhu 5891f00967 issue #3037:Add assetsmananger lua binding and a releated test sample 2013-10-31 21:52:28 +08:00
James Chen 8884c58ac1 issue #2826: Updating ScriptingCore.cpp. runScript small fix. 2013-10-31 21:03:06 +08:00
samuelhu 7c45ddafe2 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into developAssetsManager
Conflicts:
	build/cocos2d_libs.xcodeproj/project.pbxproj
2013-10-31 17:22:14 +08:00
James Chen 4b2429186c closed #3093: The last test of OpenglTest crashes on Windows. 2013-10-31 16:27:00 +08:00
samuelhu de4b4dcc73 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into developLuaOcBridge 2013-10-31 15:23:25 +08:00
samuelhu faf3b30e9b issue #3069:Add LuaObjectCBridge and related test sample 2013-10-31 15:20:53 +08:00
James Chen f478e2d2a5 issue #2826: Bug fixes for win32. 2013-10-31 15:15:52 +08:00
James Chen 6f978c5cbd issue #2826: Bug fixes after using Spidermonkey v25. Adding JSB_AUTOCOMPARTMENT_WITH_GLOBAL_OBJCET macro. 2013-10-31 15:13:49 +08:00
dingpinglv 7e8faed7af fixed #3048: rename some comments 2013-10-31 14:36:17 +08:00
dingpinglv f172abbc14 fixed #3048: add some comments for cc.rect 2013-10-31 14:31:25 +08:00
dingpinglv c116d070d3 Closed #3048: cc.rect can receiving different type parameters now 2013-10-31 14:16:42 +08:00
James Chen 0f7a99f898 [sp v25] Don't use 'using namespace std;' to make android build happy. 2013-10-31 11:15:18 +08:00
James Chen 541a0478ac [sp v25] Removing unused comments in main.js 2013-10-31 11:15:18 +08:00
James Chen d2fc29dbfa [sp v25] Updating Debugger script. 2013-10-31 11:15:17 +08:00
James Chen a81998ccf6 [sp v25] Debugger script, loading file is ok. 2013-10-31 11:15:17 +08:00
James Chen d1b88b0a78 [sp v25] Updating auto-generated and bindings-generated submodules. 2013-10-31 11:15:17 +08:00
James Chen 3b86d6398f [sp v25] Fixing complication errors after updating Spidermonkey to v25. 2013-10-31 11:15:17 +08:00
samuelhu 1f07a659a6 issue #3069:Modify layer lua register and add some compatible lua binding functions 2013-10-31 09:49:04 +08:00
samuelhu c08a09a7e0 #3049:Add LICENSE_JSON4LUA and some constant values. 2013-10-30 10:52:04 +08:00
samuelhu 471bbb8af9 issue #3049:Add XMLHttpRequest lua binding and corresponding test sample 2013-10-29 18:21:15 +08:00
samuelhu b611177a65 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into developHttp 2013-10-29 17:58:00 +08:00
samuelhu 70082ddc29 issue #3409:Add XMLHttpRequest lua binding and corresponding test sample 2013-10-29 17:54:35 +08:00
James Chen bb568e84e8 Updating auto generated binding codes. 2013-10-29 15:09:13 +08:00
samuelhu 3508213615 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into developHttp
Conflicts:
	build/cocos2d_libs.xcodeproj/project.pbxproj
2013-10-29 11:45:19 +08:00
samuelhu a4d028e905 issue #3409:Add XMLHttpRequest lua binding and corresponding test sample 2013-10-29 11:40:41 +08:00
James Chen 48ce5e39fe EventDispatcher is managed by Director now, like Scheduler and ActionManager. 2013-10-26 15:04:01 +08:00
James Chen 1339ef7ecb [JSB] These are only for v2.x JSB compatibility after removing controller codes in Layer. 2013-10-25 15:20:06 +08:00
James Chen a56475e872 Updating jsb. 2013-10-25 10:53:46 +08:00
Dhilan007 56ef197146 update the reference to cocos2d-x repo. 2013-10-24 18:36:36 +08:00
Dhilan007 fd993e2fa2 issues #2905:split jsbinding module 2013-10-24 17:54:57 +08:00
samuelhu d7689073e0 issue #3049:Add XMLHttpRequest lua binding and corresponding test sample 2013-10-24 11:12:21 +08:00
samuelhu 26caaa0a36 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into developAssetsManager 2013-10-23 09:57:21 +08:00
minggo abcf8f268d fix conflicts 2013-10-22 18:36:13 +08:00
minggo 6a664d480a issue #2905:samples build ok on linux 2013-10-22 18:01:56 +08:00
samuelhu 5f769b2313 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into developAssetsManager 2013-10-22 16:52:44 +08:00
James Chen feee6ca84b Merge pull request #3978 from HoGarfield/cc.RESOLUTION_POLICY
Add cc.RESOLUTION_POLICY to jsb_cocos2d.js,so it can use setDesignResolutionSize in cc.EGLView
2013-10-22 01:34:44 -07:00
samuelhu be1f17ca0f issue #3037:Add assetsmananger lua binding and a releated test sample 2013-10-22 16:14:49 +08:00
garfield_ho 55d45081f6 Fixed name 2013-10-22 15:41:43 +08:00
Dhilan007 232f0d598b issues #2905:add new vs project 2013-10-21 22:21:11 +08:00
Dhilan007 f11dba586a issue #2905:modification vs-project for folder structure change 2013-10-21 22:09:21 +08:00
garfield_ho 54ac8f3537 Add cc.RESOLUTION_POLICY to jsb_cocos2d.js,so it can use setDesignResolutionSize in cc.EGLView 2013-10-19 16:44:14 +08:00
dualface 8f2f524f2d fix tolua_fix, cleanup peertable after object deleted 2013-10-18 11:30:28 +08:00
James Chen 39afa3b8df Merge pull request #3967 from dumganhar/change-url
Changing the submodule URL for 'auto-generated'.
2013-10-17 19:00:36 -07:00
James Chen 8c0d7e151c Updating the submodule reference of 'auto-generated'. 2013-10-18 10:02:47 +08:00
minggo 9c3cac759c issue #2905:simple game and assets manager build ok on android 2013-10-17 18:39:37 +08:00
minggo e50f9fc43b issue #2905: jsbinding samples and lua binding samples build ok on android 2013-10-17 15:04:30 +08:00
minggo 8f9756f030 issue #2905:TestJavascript build ok on Android 2013-10-17 11:28:57 +08:00
James Chen afe2b8e0c1 Update auto-generated submodule manually. 2013-10-16 17:37:34 +08:00
James Chen 225738ecc5 issue #2905: [iOS Mac] HelloLua and TestLua work now. 2013-10-16 17:19:02 +08:00
James Chen 352d1f6768 issue #2905: Renaming lua/cocos2dx_support to lua/bindings. 2013-10-16 16:40:07 +08:00
James Chen 6fba0dd5db issue #2905: [iOS Mac] TestJavascript works now. 2013-10-16 15:43:59 +08:00
James Chen f6275667bf Removing unused ios projects. 2013-10-12 15:02:28 +08:00
James Chen 7de6646213 Don't ignore (D|d)ebugXXX folders or files. And move scripting/javascript/bindings/js to 'scripting/javascript/script/' folder. 2013-10-12 14:56:40 +08:00
minggo 5acbe663e0 issue #2905: add missing files 2013-10-12 13:44:57 +08:00
minggo ad6325b0dd fix conflicts 2013-10-12 11:31:32 +08:00
minggo 4313c46e93 issue #2905:adjust folder structure 2013-10-12 11:22:05 +08:00