Commit 1893b56e authored by Michael Sawyer's avatar Michael Sawyer
Browse files

Move taskmgr shutdown to the correct place.

parent 85dd6d77
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: dig.c,v 1.53 2000/06/29 05:21:08 mws Exp $ */
/* $Id: dig.c,v 1.54 2000/06/30 14:11:45 mws Exp $ */
#include <config.h>
#include <stdlib.h>
......@@ -25,6 +25,7 @@ extern int h_errno;
#include <isc/app.h>
#include <isc/string.h>
#include <isc/util.h>
#include <isc/task.h>
#include <dns/message.h>
#include <dns/name.h>
......@@ -63,6 +64,7 @@ extern char keynametext[MXNAME];
extern char keysecret[MXNAME];
extern dns_tsigkey_t *key;
extern isc_boolean_t validated;
extern isc_taskmgr_t *taskmgr;
extern isc_boolean_t debugging;
extern isc_boolean_t isc_mem_debugging;
......@@ -992,7 +994,7 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
show_usage();
exit (exitcode);
} else if (strcmp(rv[0], "-memdebug") == 0) {
isc_mem_debugging = ISC_TRUE;
isc_mem_debugging = 1;
} else if (strcmp(rv[0], "-debug") == 0) {
debugging = ISC_TRUE;
} else if (strncmp(rv[0], "-x", 2) == 0) {
......@@ -1221,9 +1223,13 @@ main(int argc, char **argv) {
setup_system();
start_lookup();
isc_app_run();
isc_app_finish();
if (taskmgr != NULL) {
debug ("Freeing taskmgr");
isc_taskmgr_destroy(&taskmgr);
}
if (isc_mem_debugging)
isc_mem_stats(mctx, stderr);
isc_app_finish();
if (mctx != NULL)
isc_mem_destroy(&mctx);
return (exitcode);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: dighost.c,v 1.63 2000/06/29 07:43:46 explorer Exp $ */
/* $Id: dighost.c,v 1.64 2000/06/30 14:11:46 mws Exp $ */
/*
* Notice to programmers: Do not use this code as an example of how to
......@@ -2021,6 +2021,7 @@ free_lists(int _exitcode) {
debug ("Freeing global server %p", s);
ptr = s;
s = ISC_LIST_NEXT(s, link);
debug ("ptr is now %p", ptr);
isc_mem_free(mctx, ptr);
}
o = ISC_LIST_HEAD(search_list);
......@@ -2042,10 +2043,6 @@ free_lists(int _exitcode) {
debug ("Freeing task");
isc_task_detach(&global_task);
}
if (taskmgr != NULL) {
debug ("Freeing taskmgr");
isc_taskmgr_destroy(&taskmgr);
}
if (key != NULL) {
debug ("Freeing key %p", key);
dns_tsigkey_setdeleted(key);
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: host.c,v 1.31 2000/06/29 05:21:11 mws Exp $ */
/* $Id: host.c,v 1.32 2000/06/30 14:11:48 mws Exp $ */
#include <config.h>
#include <stdlib.h>
......@@ -30,6 +30,7 @@ extern int h_errno;
#include <isc/commandline.h>
#include <isc/string.h>
#include <isc/util.h>
#include <isc/task.h>
#include <dig/dig.h>
......@@ -50,6 +51,7 @@ extern int ndots;
extern int tries;
extern int lookup_counter;
extern int exitcode;
extern isc_taskmgr_t *taskmgr;
isc_boolean_t short_form = ISC_TRUE,
filter = ISC_FALSE,
......@@ -696,6 +698,10 @@ main(int argc, char **argv) {
setup_system();
start_lookup();
isc_app_run();
if (taskmgr != NULL) {
debug ("Freeing taskmgr");
isc_taskmgr_destroy(&taskmgr);
}
if (isc_mem_debugging)
isc_mem_stats(mctx, stderr);
isc_app_finish();
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: nslookup.c,v 1.21 2000/06/29 05:21:12 mws Exp $ */
/* $Id: nslookup.c,v 1.22 2000/06/30 14:11:49 mws Exp $ */
#include <config.h>
......@@ -36,6 +36,7 @@ extern int h_errno;
#include <isc/string.h>
#include <isc/timer.h>
#include <isc/util.h>
#include <isc/task.h>
#include <dig/dig.h>
......@@ -57,6 +58,7 @@ extern int tries;
extern int lookup_counter;
extern char fixeddomain[MXNAME];
extern int exitcode;
extern isc_taskmgr_t *taskmgr;
isc_boolean_t short_form = ISC_TRUE, printcmd = ISC_TRUE,
filter = ISC_FALSE, showallsoa = ISC_FALSE,
......@@ -875,6 +877,10 @@ main(int argc, char **argv) {
free_lists(0);
isc_mutex_destroy(&lock);
isc_condition_destroy(&cond);
if (taskmgr != NULL) {
debug ("Freeing taskmgr");
isc_taskmgr_destroy(&taskmgr);
}
if (isc_mem_debugging)
isc_mem_stats(mctx, stderr);
isc_app_finish();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment