Permalink
Browse files

Fix memory leaks in mod storage (#7500)

  • Loading branch information...
red-001 authored and nerzhul committed Jun 30, 2018
1 parent 9f19b7d commit 227c71eb76e019873b30e2d3893b68307d51d58f
Showing with 6 additions and 1 deletion.
  1. +5 −0 src/script/lua_api/l_storage.cpp
  2. +1 −1 src/script/lua_api/l_storage.h
@@ -58,6 +58,11 @@ StorageRef::StorageRef(ModMetadata *object):
{
}

StorageRef::~StorageRef()
{
delete m_object;
}

void StorageRef::create(lua_State *L, ModMetadata *object)
{
StorageRef *o = new StorageRef(object);
@@ -50,7 +50,7 @@ class StorageRef : public MetaDataRef

public:
StorageRef(ModMetadata *object);
~StorageRef() = default;
~StorageRef();

static void Register(lua_State *L);
static void create(lua_State *L, ModMetadata *object);

0 comments on commit 227c71e

Please sign in to comment.