⬆️ 🎨 Transfer to Node3D

This commit is contained in:
raub 2018-04-28 14:56:26 +03:00
parent 69e624ffdb
commit b37add7c1b
6 changed files with 54 additions and 61 deletions

6
.gitignore vendored
View File

@ -2,8 +2,10 @@
.cproject .cproject
.project .project
.lock-wscript .lock-wscript
build*/
.DS_Store .DS_Store
Debug Debug/
node_modules node_modules/
package-lock.json package-lock.json
binary/
*.log *.log

View File

@ -1,14 +1,15 @@
*.log *.log
.cproject .cproject
.DS_Store
.eslintrc .eslintrc
.gitignore .gitignore
.idea .idea
.lock-wscript .lock-wscript
.project .project
binary/
build*/
CPPLINT.cfg CPPLINT.cfg
Debug Debug/
examples examples/
node_modules
package-lock.json package-lock.json
test test/
qt/

View File

@ -74,6 +74,8 @@ public:
Nan::SetPrototypeMethod(proto, "setMaxListeners", jsSetMaxListeners); Nan::SetPrototypeMethod(proto, "setMaxListeners", jsSetMaxListeners);
Nan::SetPrototypeMethod(proto, "rawListeners", jsRawListeners); Nan::SetPrototypeMethod(proto, "rawListeners", jsRawListeners);
Nan::SetPrototypeMethod(proto, "destroy", jsDestroy);
// -------- static // -------- static
V8_VAR_FUNC ctor = Nan::GetFunction(proto).ToLocalChecked(); V8_VAR_FUNC ctor = Nan::GetFunction(proto).ToLocalChecked();
@ -141,8 +143,14 @@ public:
void _destroy() { DES_CHECK; void _destroy() { DES_CHECK;
_isDestroyed = true; _isDestroyed = true;
// emit("destroy");
_listeners.clear();
_raw.clear();
_wrappedIds.clear();
_rawIds.clear();
} }
@ -644,6 +652,15 @@ private:
} }
static NAN_METHOD(jsDestroy) { THIS_AUDIO_NODE; THIS_CHECK;
eventEmitter->emit("destroy");
eventEmitter->_destroy();
}
private: private:
bool _isDestroyed; bool _isDestroyed;

View File

@ -36,7 +36,7 @@ const paths = dir => {
const binPath = `${dir}/${currentDir}`; const binPath = `${dir}/${currentDir}`;
if (isWindows) { if (isWindows) {
process.env.path = `${process.env.path ? `${process.env.path};` : ''}${binPath}`; process.env.path = `${binPath};${process.env.path ? `${process.env.path}` : ''}`;
} }
const remPath = remDirs.map(k => `${dir}/${k}`).join(' '); const remPath = remDirs.map(k => `${dir}/${k}`).join(' ');

View File

@ -1,37 +1,31 @@
{ {
"author": "Luis Blanco <luisblanco1337@gmail.com>",
"name": "addon-tools-raub", "name": "addon-tools-raub",
"version": "0.1.7", "version": "0.1.7",
"author": "Luis Blanco <raubtierxxx@gmail.com>",
"description": "A set of extra tools for Node.js addons", "description": "A set of extra tools for Node.js addons",
"license": "MIT",
"main": "index.js", "main": "index.js",
"keywords": [ "keywords": [
"node", "support",
"addon", "headers",
"header",
"include", "include",
"platform",
"build",
"paths",
"events",
"eventemitter", "eventemitter",
"emitter",
"cpp",
"compile",
"macros",
"helpers",
"utils" "utils"
], ],
"engines": {
"node": ">=8.11.1",
"npm": ">=5.6.0"
},
"maintainers": [ "maintainers": [
{ {
"name": "Luis Blanco", "name": "Luis Blanco",
"email": "raubtierxxx@gmail.com", "email": "luisblanco1337@gmail.com",
"skype": "rauber666" "skype": "rauber666"
} }
], ],
"license": "MIT",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/raub/node-addon-tools.git" "url": "https://github.com/node-3d/node-addon-tools.git"
}, },
"dependencies": { "dependencies": {
"nan": "2.10.0" "nan": "2.10.0"

View File

@ -1,38 +1,17 @@
{ {
"name": "TEST", "name": "test",
"author": "Luis Blanco <raubtierxxx@gmail.com>", "version": "0.0.0",
"description": "TEST", "private": true,
"version": "0.0.1", "main": "mocha",
"main": "mocha", "scripts": {
"scripts": { "test": "mocha",
"test": "mocha", "start": "mocha",
"start": "mocha" "preinstall": "cd .. && npm i"
}, },
"keywords": [ "dependencies": {
"node", "addon-tools-raub": "file:../",
"addon", "chai": "^4.1.2",
"header", "mocha": "^5.0.0",
"include", "sinon": "^4.2.2"
"platform", }
"build",
"paths"
],
"maintainers": [
{
"name": "Luis Blanco",
"email": "raubtierxxx@gmail.com",
"skype": "rauber666"
}
],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/raub/node-addon-tools.git"
},
"dependencies": {
"addon-tools-raub": "file:../",
"chai": "^4.1.2",
"mocha": "^5.0.0",
"sinon": "^4.2.2"
}
} }