Remember how to keep a parse tree around after the parser is closed

This commit is contained in:
Eric Fischer 2017-08-28 13:56:52 -07:00
parent 5878213516
commit b7df68c164

View File

@ -1049,8 +1049,8 @@ json_object *read_filter(const char *fname) {
fprintf(stderr, "%s: %s\n", fname, jp->error);
exit(EXIT_FAILURE);
}
// XXX clone tree instead of leaving pull open
json_disconnect(filter);
json_end(jp);
fclose(fp);
return filter;
}
@ -1063,8 +1063,8 @@ json_object *parse_filter(const char *s) {
fprintf(stderr, "%s\n", jp->error);
exit(EXIT_FAILURE);
}
// XXX clone tree instead of leaving pull open
json_disconnect(filter);
json_end(jp);
return filter;
}
@ -1301,5 +1301,9 @@ int main(int argc, char **argv) {
mbtiles_close(outdb, argv[0]);
}
if (filter != NULL) {
json_free(filter);
}
return 0;
}