diff options
author | Karl Wette <karl.wette@ligo.org> | 2020-05-31 10:26:15 +1000 |
---|---|---|
committer | Karl Wette <karl.wette@ligo.org> | 2020-05-31 22:11:51 +1000 |
commit | d73ef20475ac77e5f0fe4f641759e4bebcdc2428 (patch) | |
tree | a81eb6e1b412aefcfa87d6d13a1f900c38ee4cd7 /Lib/octave | |
parent | cec09a7e6e6b0d27a7639ef76acea5813f7a70fd (diff) | |
download | swig-d73ef20475ac77e5f0fe4f641759e4bebcdc2428.tar.gz |
octrun.swg: ensure type_id() is set correctly
Diffstat (limited to 'Lib/octave')
-rw-r--r-- | Lib/octave/octrun.swg | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Lib/octave/octrun.swg b/Lib/octave/octrun.swg index 944b72a63..1069e0e54 100644 --- a/Lib/octave/octrun.swg +++ b/Lib/octave/octrun.swg @@ -1058,7 +1058,13 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); octave_swig_type *ptr; public: octave_swig_ref(octave_swig_type *_ptr = 0) - :ptr(_ptr) { } + :ptr(_ptr) + { + // Ensure type_id() is set correctly + if (t_id == -1) { + t_id = octave_swig_ref::static_type_id(); + } + } ~octave_swig_ref() { if (ptr) ptr->decref(); } @@ -1199,8 +1205,13 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own); public: octave_swig_packed(swig_type_info *_type = 0, const void *_buf = 0, size_t _buf_len = 0) - : type(_type), buf((const char*)_buf, (const char*)_buf + _buf_len) { - } + : type(_type), buf((const char*)_buf, (const char*)_buf + _buf_len) + { + // Ensure type_id() is set correctly + if (t_id == -1) { + t_id = octave_swig_packed::static_type_id(); + } + } bool copy(swig_type_info *outtype, void *ptr, size_t sz) const { if (outtype && outtype != type) |