Skip to content

Commit

Permalink
Merge pull request #13667 from rgacogne/ddist-coverage-cleanup-lua-on…
Browse files Browse the repository at this point in the history
…-exception

dnsdist: Clean up the Lua objects before exiting
  • Loading branch information
rgacogne authored Jan 8, 2024
2 parents 4223c4d + bae38b2 commit 369b105
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pdns/dnsdist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2553,8 +2553,8 @@ static void usage()
#ifdef COVERAGE
static void cleanupLuaObjects()
{
/* when our coverage mode is enabled, we need to make
that the Lua objects destroyed before the Lua contexts. */
/* when our coverage mode is enabled, we need to make sure
that the Lua objects are destroyed before the Lua contexts. */
g_ruleactions.setState({});
g_respruleactions.setState({});
g_cachehitrespruleactions.setState({});
Expand Down Expand Up @@ -3243,6 +3243,7 @@ int main(int argc, char** argv)
errlog("Fatal pdns error: %s", ae.reason);
}
#ifdef COVERAGE
cleanupLuaObjects();
exit(EXIT_FAILURE);
#else
_exit(EXIT_FAILURE);
Expand All @@ -3252,6 +3253,7 @@ int main(int argc, char** argv)
{
errlog("Fatal error: %s", e.what());
#ifdef COVERAGE
cleanupLuaObjects();
exit(EXIT_FAILURE);
#else
_exit(EXIT_FAILURE);
Expand All @@ -3261,6 +3263,7 @@ int main(int argc, char** argv)
{
errlog("Fatal pdns error: %s", ae.reason);
#ifdef COVERAGE
cleanupLuaObjects();
exit(EXIT_FAILURE);
#else
_exit(EXIT_FAILURE);
Expand Down

0 comments on commit 369b105

Please sign in to comment.