From f406e52db34edae0f333e7c19685ff2046ffd1b3 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 22 Feb 2005 03:25:38 +0000 Subject: [PATCH] add LuaReference::Unset; LuaExpression sets nothing by default (so LuaExpressoin is "free" if not actually used) --- stepmania/src/LuaReference.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stepmania/src/LuaReference.h b/stepmania/src/LuaReference.h index e6687b699d..427fb8e56c 100644 --- a/stepmania/src/LuaReference.h +++ b/stepmania/src/LuaReference.h @@ -25,6 +25,7 @@ public: /* Return true if set. (SetFromNil() counts as being set.) */ bool IsSet() const; + void Unset() { Unregister(); } /* Return the referenced type, or LUA_TNONE if not set. */ int GetLuaType() const; @@ -52,7 +53,7 @@ private: class LuaExpression: public LuaReference { public: - LuaExpression( const CString &sExpression = "" ) { SetFromExpression( sExpression ); } + LuaExpression( const CString &sExpression = "" ) { if( sExpression != "" ) SetFromExpression( sExpression ); } void SetFromExpression( const CString &sExpression ); protected: