Skip to content

Commit cf2340c

Browse files
authored
Merge pull request #73 from neogeek/hotfix/free-memory
[hotfix] Added missing call for freeing memory from cpp method.
2 parents 097fa29 + dbbc7bc commit cf2340c

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

RhythmGameUtilities/Scripts/Utilities.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ public static List<BeatBar> CalculateBeatBars(Dictionary<int, int> bpmChanges, i
113113
beatBars.Add(beatBar);
114114
}
115115

116+
Marshal.FreeHGlobal(ptrArray);
117+
116118
return beatBars;
117119
}
118120

UnityPackage/Scripts/Utilities.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ public static List<BeatBar> CalculateBeatBars(Dictionary<int, int> bpmChanges, i
113113
beatBars.Add(beatBar);
114114
}
115115

116+
Marshal.FreeHGlobal(ptrArray);
117+
116118
return beatBars;
117119
}
118120

include/RhythmGameUtilities/Common.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#pragma once
22

3+
#include <cstring>
34
#include <regex>
45
#include <sstream>
56

include/RhythmGameUtilities/ParsersInternal.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
22

3+
#include <cstring>
4+
35
#include "Parsers.hpp"
46

57
#ifdef _WIN32

0 commit comments

Comments
 (0)