From 14e1c4728803dab5a4259eaffd1b31a3c880d590 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 23 Sep 2015 08:23:30 +0100 Subject: [PATCH] Fix Ruby smartptr feature for classes in a namespace --- Source/Modules/ruby.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Modules/ruby.cxx b/Source/Modules/ruby.cxx index e44f0d214..bbb80c959 100644 --- a/Source/Modules/ruby.cxx +++ b/Source/Modules/ruby.cxx @@ -1830,7 +1830,7 @@ public: Wrapper_add_local(f, "classname", classname); } if (action) { - SwigType *smart = Swig_cparse_smartptr(n); + SwigType *smart = Swig_cparse_smartptr(pn); String *result_name = NewStringf("%s%s", smart ? "smart" : "", Swig_cresult_name()); if (smart) { String *result_var = NewStringf("%s *%s = 0", SwigType_namestr(smart), result_name); @@ -1930,7 +1930,8 @@ public: /* Extra code needed for new and initialize methods */ if (current == CONSTRUCTOR_ALLOCATE) { - SwigType *smart = Swig_cparse_smartptr(n); + Node *pn = Swig_methodclass(n); + SwigType *smart = Swig_cparse_smartptr(pn); if (smart) SwigType_add_pointer(smart); String *classtype = smart ? smart : t;