From: Thomas Geymayer Date: Wed, 21 Nov 2012 23:54:44 +0000 (+0100) Subject: Extend CanvasSystemAdapter to provide access to Nasal gcSave and gcRelease X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=767184cf3cb4d4a99e15afc481645a4420712e30;p=simgear.git Extend CanvasSystemAdapter to provide access to Nasal gcSave and gcRelease --- diff --git a/simgear/canvas/CanvasSystemAdapter.hxx b/simgear/canvas/CanvasSystemAdapter.hxx index 91fc2740..5dfa8ac3 100644 --- a/simgear/canvas/CanvasSystemAdapter.hxx +++ b/simgear/canvas/CanvasSystemAdapter.hxx @@ -20,6 +20,7 @@ #define SG_CANVAS_SYSTEM_ADAPTER_HXX_ #include "canvas_fwd.hxx" +#include namespace simgear { @@ -35,6 +36,18 @@ namespace canvas virtual void addCamera(osg::Camera* camera) const = 0; virtual void removeCamera(osg::Camera* camera) const = 0; virtual osg::Image* getImage(const std::string& path) 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; }; } // namespace canvas