From 8e471a05c1d2e00a3d367cff36cb3788b9681491 Mon Sep 17 00:00:00 2001 From: Bill Welden Date: Tue, 26 Feb 2013 08:53:03 -0800 Subject: Fixed a problem where auto downcasting from a smart pointer to a derived class for which no smart pointer was registered would cause a crash. Now a smart pointer is only downcast to the most derived class which is bound and for which a smart pointer is registered. --- src/embind/embind.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/embind/embind.js b/src/embind/embind.js index 5a49d177..277515a5 100755 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -619,7 +619,7 @@ RegisteredPointer.prototype.getDynamicDowncastType = function(ptr) { var derivation = Module.__getDerivationPath(type, this.pointeeType.rawType); for (var i = 0; i < derivation.size(); i++) { downcastType = typeRegistry[derivation.at(i)]; - if (downcastType) { + if (downcastType && (!this.isSmartPointer || downcastType.smartPointerType)) { break; } } -- cgit v1.2.3-70-g09d2