dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
gedcom-parse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9705cb4
)
Cleanup xref table at exit of program (not after check), or when new file
author
Peter Verthez
<Peter.Verthez@advalvas.be>
Sun, 25 Aug 2002 11:21:14 +0000
(11:21 +0000)
committer
Peter Verthez
<Peter.Verthez@advalvas.be>
Sun, 25 Aug 2002 11:21:14 +0000
(11:21 +0000)
is parsed.
gedcom/xref.c
patch
|
blob
|
history
diff --git
a/gedcom/xref.c
b/gedcom/xref.c
index ea3e1fa7ded85cc6cbb8f445175e313aa606d489..1aa3b6c21347685b6312ca271ac7e3f29a721103 100644
(file)
--- a/
gedcom/xref.c
+++ b/
gedcom/xref.c
@@
-83,8
+83,20
@@
struct xref_node *make_xref_node()
return xr;
}
+void cleanup_xrefs()
+{
+ hash_free(xrefs);
+ xrefs = NULL;
+}
+
void make_xref_table()
{
+ if (xrefs)
+ cleanup_xrefs();
+ else
+ /* Only register initially (if xrefs is still NULL) */
+ /* So that it is only registered once */
+ atexit(cleanup_xrefs);
xrefs = hash_create(HASHCOUNT_T_MAX, NULL, NULL);
hash_set_allocator(xrefs, xref_alloc, xref_free, NULL);
}
@@
-111,7
+123,6
@@
int check_xref_table()
}
}
- hash_free(xrefs);
return result;
}