Init functions for the lexers.
[gedcom-parse.git] / gedcom / gedcom_lohi.lex
index d6092a6d67d158c3bb2e9a8c7baf27b53dc72826..a2f82a96cd361f8ba4d89330fe13180f2eb57b5c 100644 (file)
@@ -219,8 +219,12 @@ ACTION_BEFORE_REGEXPS
 
 %%
 
+static int exitfuncregistered = 0;
+
 int yywrap()
 {
+  if (! exitfuncregistered && atexit(yylex_cleanup) == 0)
+    atexit(yylex_cleanup);
   return 1;
 }