From: Thomas Geymayer Date: Mon, 14 Oct 2013 22:49:13 +0000 (+0200) Subject: Canvas: use new naGCSave/naGCRelease functions. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=42c39b6be38d1d5e0cd4ad635b986948f2cce3af;p=simgear.git Canvas: use new naGCSave/naGCRelease functions. --- diff --git a/simgear/canvas/CanvasEventListener.cxx b/simgear/canvas/CanvasEventListener.cxx index 03675ff7..5dcfab51 100644 --- a/simgear/canvas/CanvasEventListener.cxx +++ b/simgear/canvas/CanvasEventListener.cxx @@ -43,14 +43,13 @@ namespace canvas "canvas::NasalEventListener: invalid function argument" ); - _gc_key = sys_adapter->gcSave(_code); + _gc_key = naGCSave(_code); } //---------------------------------------------------------------------------- NasalEventListener::~NasalEventListener() { - if( !_sys.expired() ) - _sys.lock()->gcRelease(_gc_key); + naGCRelease(_gc_key); } //---------------------------------------------------------------------------- diff --git a/simgear/canvas/CanvasSystemAdapter.hxx b/simgear/canvas/CanvasSystemAdapter.hxx index a2bb1fe2..6a250f4d 100644 --- a/simgear/canvas/CanvasSystemAdapter.hxx +++ b/simgear/canvas/CanvasSystemAdapter.hxx @@ -39,18 +39,6 @@ namespace canvas 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. */