Canvas: use new naGCSave/naGCRelease functions.
This commit is contained in:
@@ -43,14 +43,13 @@ namespace canvas
|
|||||||
"canvas::NasalEventListener: invalid function argument"
|
"canvas::NasalEventListener: invalid function argument"
|
||||||
);
|
);
|
||||||
|
|
||||||
_gc_key = sys_adapter->gcSave(_code);
|
_gc_key = naGCSave(_code);
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
NasalEventListener::~NasalEventListener()
|
NasalEventListener::~NasalEventListener()
|
||||||
{
|
{
|
||||||
if( !_sys.expired() )
|
naGCRelease(_gc_key);
|
||||||
_sys.lock()->gcRelease(_gc_key);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -39,18 +39,6 @@ namespace canvas
|
|||||||
|
|
||||||
virtual naContext getNasalContext() const = 0;
|
virtual naContext getNasalContext() const = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* Save passed reference to Nasal object from being deleted by the
|
|
||||||
* garbage collector.
|
|
||||||
*/
|
|
||||||
virtual int gcSave(naRef r) = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Release an object previously passed to ::gcSave to allow it being
|
|
||||||
* cleaned up by the garbage collector.
|
|
||||||
*/
|
|
||||||
virtual void gcRelease(int key) = 0;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Call a Nasal function with the given environment and arguments.
|
* Call a Nasal function with the given environment and arguments.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user