Skip to content

Commit 227c71e

Browse files
red-001nerzhul
authored andcommittedJun 30, 2018
Fix memory leaks in mod storage (#7500)
1 parent 9f19b7d commit 227c71e

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

Diff for: ‎src/script/lua_api/l_storage.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ StorageRef::StorageRef(ModMetadata *object):
5858
{
5959
}
6060

61+
StorageRef::~StorageRef()
62+
{
63+
delete m_object;
64+
}
65+
6166
void StorageRef::create(lua_State *L, ModMetadata *object)
6267
{
6368
StorageRef *o = new StorageRef(object);

Diff for: ‎src/script/lua_api/l_storage.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class StorageRef : public MetaDataRef
5050

5151
public:
5252
StorageRef(ModMetadata *object);
53-
~StorageRef() = default;
53+
~StorageRef();
5454

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

0 commit comments

Comments
 (0)
Please sign in to comment.