From: Rob S. <rob...@si...> - 2007-05-10 17:54:15
|
From: William S Fulton <ws...@fu...> > Rob Stewart <robert.stewart <at> sig.com> writes: > > > I just moved up from 1.3.29 to 1.3.31 and now the virtual > > functions in my Director classes are stuck in infinite recursion > > loops. Looking at the generated wrapper code, I don't see the > > swig_up static data member or the get_swig_up() member functions > > on the Directors. What's wrong? > > Read the CHANGES file (09/13/2006) for an explanation of the change. You > shouldn't be getting recursive calls, but as you are, please post a comple > standalone example demonstrating the problem and I'll take a look. I've found what leads to the problem. I've attached a tarball with code that illustrates the issue. Run build.sh (after adjusting the shell variables at the top) to build the module. (That was easier than trying to set up a makefile since I could just copy, paste, and edit the commands our build system already computed.) Once you build the module, just run "python example.py." The key characteristics are: - virtual function in C++ base class - director for C++ derivate - Python derivate with no "override" for the virtual function When the virtual function is called, the director's override calls the default proxy implementation which calls the wrapper of the virtual function. The wrapper makes a polymorphic call to that virtual function so the director's override is called again. -- Rob Stewart rob...@si... Software Engineer http://www.sig.com Susquehanna International Group, LLP using std::disclaimer; ===File example.tgz=== wµh0Þ²ZûHÖê6 û´FÇx¼ÜÑEÁ#>TÓ/ ãô+Ý'±`.iT-d78ÎqõS\l*¹Ç¹=ù1§Á,é]{º ÐK,ÆïQ*Ä 8áANxm5Oø¨~zƼ¦½o))ûª@=S$j)ßJØF9¹*Oîcº?ÜÁ®Êª ÿ°jÖ |