summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Garcia Murillo <sergio.garcia.murillo@gmail.com>2021-03-05 15:08:17 +0100
committerGitHub <noreply@github.com>2021-03-05 15:08:17 +0100
commit6aeee8effc089ba21bb771dd329350ac5b0c755f (patch)
tree4181f9b9e17250d41c04ab3e7db7bcf3e5bc2754
parentd38c8d512f988a2f332d0597c109231a1b1b805d (diff)
downloadswig-6aeee8effc089ba21bb771dd329350ac5b0c755f.tar.gz
Use SWIG_TypeCast in SWIG_V8_ConvertInstancePtr if types don't match (#3)
Use SWIG_TypeCast in SWIG_V8_ConvertInstancePtr if types don't match
-rw-r--r--Lib/javascript/v8/javascriptrun.swg6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/javascript/v8/javascriptrun.swg b/Lib/javascript/v8/javascriptrun.swg
index 62c7bf829..45dd8fe28 100644
--- a/Lib/javascript/v8/javascriptrun.swg
+++ b/Lib/javascript/v8/javascriptrun.swg
@@ -289,8 +289,12 @@ SWIGRUNTIME int SWIG_V8_ConvertInstancePtr(SWIGV8_OBJECT objRef, void **ptr, swi
if(!type_valid) {
return SWIG_TypeError;
}
+ int newmemory = 0;
+ *ptr = SWIG_TypeCast(tc, cdata->swigCObject, &newmemory);
+ } else {
+ *ptr = cdata->swigCObject;
}
- *ptr = cdata->swigCObject;
+
if(flags & SWIG_POINTER_DISOWN) {
cdata->swigCMemOwn = false;
}