From: Marcelo M. <mm...@ac...> - 2006-04-18 20:14:10
|
yes, sorry, try: %typemap(newfree) IC* GetInterface() "result->AddRef();" or %typemap(newfree) IC* GetInterface() "$1->AddRef();" Marcelo Jaroslav Gresula wrote: > Marcelo Matus wrote: > >> Oh, I see the problem now, yes, you can use the "newfree" typemap for >> forcing the extra reference when you call an "external constructor >> method", >> ie: >> >> %typemap(newfree) GetInterface() "$source->AddRef();" >> > > Sorry for bothering you again but it still does not work. I use 1.3.29 > and when I add the suggested line it issues a warning regarding > deprecated typemap feature. Even when I fixed it (replaced $source > with $1) still no luck. > > At this moment, the only way I'm able to get it working is when I add > this: > > %exception GetInterface() { > $action > result->AddRef(); > } > > But it looks to me like a sort of hack as it is based on assumption > that SWIG will assign the result of $action to a variable named 'result'. > > It's a mystery to me that refcount.i from SWIG test suite does not > define any other directives than %refobject, %unrefobject, %newobject > but when i fed SWIG with it the generated wrapper function around > B::cloner() invokes addref() ... which is exactly what I want to > achieve with my GetInterface(). > > Thanks, > Jarda > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Swig-user mailing list > Swi...@li... > https://lists.sourceforge.net/lists/listinfo/swig-user |