|
From: Marouane B. J. <mar...@ya...> - 2010-06-04 13:41:49
|
Hi,
I use SWIG 1.3.40 o generate C# wrappers.
I use directors and I have these warnings:
Warning(473): Returning a pointer or reference in a director method is not recommended.
I understand from where it comes, but I do not understand in which case it will lead to troubles.
I the infos in the Doc:
18.6.1 Memory management when returning references to member variables
18.6.2 Memory management for objects passed to the C++ layer
And I think that If I create all my objects in the C++ code then it is ok.
I explain: in the Bike example of 18.6.1 if the Bike was returned from C++ then it is ok.
In my case I have a C++ "Master class that create all the C++ instances" and when it is delete it destroy everything.
Can you confirm that if I create all my objects in the C++ code then it is ok?
But I'm using directors so I'm not so sure that what I do is enough.
Thanks,
Marouane
|