Bladeren bron

Fix build error.

aster2013 11 jaren geleden
bovenliggende
commit
73fad1dc04
2 gewijzigde bestanden met toevoegingen van 7 en 3 verwijderingen
  1. 3 0
      Source/Urho3D/LuaScript/LuaScript.cpp
  2. 4 3
      Source/Urho3D/LuaScript/pkgs/LuaScript/LuaScript.pkg

+ 3 - 0
Source/Urho3D/LuaScript/LuaScript.cpp

@@ -135,6 +135,9 @@ LuaScript::LuaScript(Context* context) :
 
 LuaScript::~LuaScript()
 {
+    functionPointerToFunctionMap_.Clear();
+    functionNameToFunctionMap_.Clear();
+    
     lua_State* luaState = luaState_;
     luaState_ = 0;
 

+ 4 - 3
Source/Urho3D/LuaScript/pkgs/LuaScript/LuaScript.pkg

@@ -40,9 +40,9 @@ static bool tolua_isfunctionorurho3dstring(lua_State* L, int lo, int def, tolua_
 static int tolua_LuaScriptLuaAPI_SubscribeToEvent(lua_State* tolua_S)
 {
     int args = lua_gettop(tolua_S);
-
-#ifndef TOLUA_RELEASE    
     tolua_Error tolua_err;
+
+#ifndef TOLUA_RELEASE
     if (args == 2)
     {   
         // SubscribeToEvent(const String eventName, void* functionOrFunctionName);
@@ -112,8 +112,9 @@ static int tolua_LuaScriptLuaAPI_SubscribeToEvent01(lua_State* tolua_S)
 static int tolua_LuaScriptLuaAPI_UnsubscribeFromEvent(lua_State* tolua_S)
 {
     int args = lua_gettop(tolua_S);
-#ifndef TOLUA_RELEASE    
     tolua_Error tolua_err;
+    
+#ifndef TOLUA_RELEASE
     if (args == 1)
     {
         // UnsubscribeFromEvent(const String eventName);