aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2013-05-06 17:50:17 +0300
committerChad Austin <chad@imvu.com>2013-05-17 12:57:15 -0700
commit259c1062644c7cf660ab34df3d7468c6904bb1da (patch)
tree62915877b2e9d2e7e25d7988011a23313c5a1cd6 /src
parent69d3621782e4b6dc131a2e5d78fdcf92047d667c (diff)
For sanity, make sure all types test the existence of the destructor stack before pushing to it. __emval_get_method_caller calls toWireType with a null destructors array.
Diffstat (limited to 'src')
-rw-r--r--src/embind/embind.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index c3cdd23a..5751bf52 100644
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -715,7 +715,7 @@ function __embind_finalize_tuple(rawTupleType) {
}
if (destructors !== null) {
destructors.push(rawDestructor, ptr);
- }
+ }
return ptr;
},
destructorFunction: rawDestructor,
@@ -832,7 +832,9 @@ var genericPointerToWireType = function(destructors, handle) {
if (this.isSmartPointer) {
var ptr = this.rawConstructor();
- destructors.push(this.rawDestructor, ptr);
+ if (destructors !== null) {
+ destructors.push(this.rawDestructor, ptr);
+ }
return ptr;
} else {
return 0;
@@ -884,7 +886,9 @@ var genericPointerToWireType = function(destructors, handle) {
clonedHandle.delete();
})
);
- destructors.push(this.rawDestructor, ptr);
+ if (destructors !== null) {
+ destructors.push(this.rawDestructor, ptr);
+ }
}
break;