Use reference counting for identifiers
This commit is contained in:
9
src/Free/Identifier.c
Normal file
9
src/Free/Identifier.c
Normal file
@@ -0,0 +1,9 @@
|
||||
#include "../../include/ground.h"
|
||||
|
||||
void _GroundFreeIdentifier(GroundIdentifier* identifier) {
|
||||
identifier->referenceCount--;
|
||||
if (identifier->referenceCount == 0) {
|
||||
free(identifier->string);
|
||||
free(identifier);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user