Skip to content

Commit

Permalink
Fix memory leaks in mod storage (#7500)
Browse files Browse the repository at this point in the history
  • Loading branch information
red-001 authored and nerzhul committed Jun 30, 2018
1 parent 9f19b7d commit 227c71e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/script/lua_api/l_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/script/lua_api/l_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 227c71e

Please sign in to comment.