Skip to content

Commit

Permalink
Fixed memory leak in strings
Browse files Browse the repository at this point in the history
  • Loading branch information
shai-almog committed Aug 9, 2023
1 parent 8e6bb26 commit 74f5f08
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vm/ByteCodeTranslator/src/cn1_globals.m
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,10 @@ void placeObjectInHeapCollection(JAVA_OBJECT obj) {
// the thread just died, mark its remaining resources
void collectThreadResources(struct ThreadLocalData *current)
{
if(threadStateData->utf8Buffer != 0) {
free(threadStateData->utf8Buffer);
threadStateData->utf8Buffer = 0;
}
for(int heapTrav = 0 ; heapTrav < current->heapAllocationSize ; heapTrav++) {
JAVA_OBJECT obj = (JAVA_OBJECT)current->pendingHeapAllocations[heapTrav];
if(obj) {
Expand Down

0 comments on commit 74f5f08

Please sign in to comment.