From: <koe...@pa...> - 2009-02-24 18:57:34
|
Hi Tobi, Thank you for clarifying this. Your solution is exactly what I needed! It now works like I expected. The cryptic error message set me off in the wrong direction. Can I quote your solution on StackOverflow? Or maybe you want to answer the question yourself and earn some badges ;-) Either way, it may help others find your answer there. Thanks again! Cheers, Koen. >----- Oorspronkelijk bericht ----- >Van : Tobi [mailto:lis...@e-...] >Verzonden : zondag , februari 22, 2009 02:25 PM >Aan : swi...@li... >CC : koe...@pa... >Onderwerp : Re: [Swig-user] Polymorphism across C++ and Ruby using SWIG > >koe...@pa... wrote: > >> You can find an example of my problem on stackoverflow (http://stackoverflow.com/questions/549249/polymorphism-across-c-and-ruby-using-swig). > >The exception message that gets raised in your example is misleading (see >bug #2587366 [1]. If you check the class of the exception, it's >ObjectPreviouslyDeleted, meaning that the underlying C struct pointer of >your Cat class is NULL. > >And it is NULL, because you forgot to call "super" in Cat's initialize() >method. This way, with the creation of Cat no C struct gets allocated, >because the Animal constructor never gets called. > >Tobias > >[1]: >http://sourceforge.net/tracker/index.php?func=detail&aid=2587366&group_id=1645&atid=101645 > > |