forked from ground/ground
Merge branch 'master' of https://chookspace.com/ground/ground
This commit is contained in:
@@ -87,11 +87,14 @@ GroundValue copyGroundValue(const GroundValue* gv) {
|
|||||||
case CHAR: newGv.data.charVal = gv->data.charVal; break;
|
case CHAR: newGv.data.charVal = gv->data.charVal; break;
|
||||||
case BOOL: newGv.data.boolVal = gv->data.boolVal; break;
|
case BOOL: newGv.data.boolVal = gv->data.boolVal; break;
|
||||||
case STRING:
|
case STRING:
|
||||||
|
/*
|
||||||
if (gv->data.stringVal != NULL) {
|
if (gv->data.stringVal != NULL) {
|
||||||
newGv.data.stringVal = strdup(gv->data.stringVal);
|
newGv.data.stringVal = strdup(gv->data.stringVal);
|
||||||
} else {
|
} else {
|
||||||
newGv.data.stringVal = NULL;
|
newGv.data.stringVal = NULL;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
newGv.data.stringVal = gv->data.stringVal;
|
||||||
break;
|
break;
|
||||||
case LIST: {
|
case LIST: {
|
||||||
List newList = createList();
|
List newList = createList();
|
||||||
@@ -258,7 +261,8 @@ void printGroundValue(GroundValue* gv) {
|
|||||||
|
|
||||||
void freeGroundValue(GroundValue* gv) {
|
void freeGroundValue(GroundValue* gv) {
|
||||||
if (gv->type == STRING && gv->data.stringVal != NULL) {
|
if (gv->type == STRING && gv->data.stringVal != NULL) {
|
||||||
free(gv->data.stringVal);
|
// leak some memory for now
|
||||||
|
// free(gv->data.stringVal);
|
||||||
gv->data.stringVal = NULL;
|
gv->data.stringVal = NULL;
|
||||||
}
|
}
|
||||||
if (gv->type == LIST && gv->data.listVal.values != NULL) {
|
if (gv->type == LIST && gv->data.listVal.values != NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user