Prevent memory leaks in the case of earlier return
from wrapper methods using const std::string & parameters. Modified Mark Traudt patch #951565. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6084 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
26b5e7000c
commit
98feab7822
1 changed files with 2 additions and 2 deletions
|
|
@ -45,9 +45,9 @@ class string;
|
|||
|
||||
%typemap(in) const string &
|
||||
%{ if (!$input) SWIG_CSharpThrowException(SWIG_CSharpNullReferenceException, "null string");
|
||||
$1 = new std::string($input); %}
|
||||
std::string $1_str($input);
|
||||
$1 = &$1_str; %}
|
||||
%typemap(out) const string & %{ $result = SWIG_csharp_string_callback($1->c_str()); %}
|
||||
%typemap(freearg) const string & %{ delete $1; %}
|
||||
|
||||
%typemap(csin) const string & "$csinput"
|
||||
%typemap(csout) const string & {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue