Several fixes to GC_VALUE, and map containers.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9724 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
7c4d3d8bd8
commit
6999e71c07
5 changed files with 78 additions and 18 deletions
|
|
@ -47,7 +47,9 @@ namespace swig {
|
|||
%typemap(out,noblock=1) GC_VALUE const & {
|
||||
$result = (VALUE )*$1;
|
||||
}
|
||||
|
||||
|
||||
%ignore LANGUAGE_OBJ;
|
||||
typedef GC_VALUE LANGUAGE_OBJ;
|
||||
}
|
||||
|
||||
%{
|
||||
|
|
@ -73,20 +75,21 @@ namespace swig {
|
|||
|
||||
GC_VALUE & operator=(const GC_VALUE& item)
|
||||
{
|
||||
GC_unregister();
|
||||
_obj = item._obj;
|
||||
_obj.GC_register();
|
||||
GC_register();
|
||||
return *this;
|
||||
}
|
||||
|
||||
void GC_register()
|
||||
{
|
||||
if ( obj != Qnil )
|
||||
if ( _obj != Qnil )
|
||||
rb_gc_register_address( &_obj );
|
||||
}
|
||||
|
||||
void GC_unregister()
|
||||
{
|
||||
if ( obj != Qnil )
|
||||
if ( _obj != Qnil )
|
||||
rb_gc_unregister_address( &_obj );
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue