aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsrc/embind/embind.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js
index 08ed7ec1..e850cc3f 100755
--- a/src/embind/embind.js
+++ b/src/embind/embind.js
@@ -588,6 +588,9 @@ RegisteredPointer.prototype.toWireType = function(destructors, handle) {
if (!(handle instanceof ClassHandle)) {
throwBindingError('Expected pointer or null, got ' + IMVU.repr(handle));
}
+ if (this.isSmartPointer && undefined === handle.$$.smartPtr) {
+ throwBindingError('Passing raw pointer to smart pointer is illegal');
+ }
if (handle.$$.pointeeType.isPolymorphic) {
fromRawType = handle.$$.pointeeType.getDynamicRawPointerType(handle.$$.ptr);
} else {