1 | /* |
1 | /* |
2 | * main.C: Initialisation routine. |
2 | * main.C: Initialisation routine. |
3 | * Rights to this code are documented in doc/pod/license.pod. |
3 | * Rights to this code are documented in doc/pod/license.pod. |
4 | */ |
4 | */ |
5 | |
5 | |
6 | static char const rcsid[] = "$Id: main.C,v 1.6 2007/08/28 22:18:31 pippijn Exp $"; |
6 | static char const rcsid[] = "$Id: main.C,v 1.7 2007/08/30 19:56:26 pippijn Exp $"; |
7 | |
7 | |
8 | #include "atheme.h" |
8 | #include "atheme.h" |
9 | #include <ermyth/database.h> |
9 | #include <ermyth/database.h> |
10 | #include <ermyth/module.h> |
10 | #include <ermyth/module.h> |
11 | #include <account/kline.h> |
11 | #include <account/kline.h> |
… | |
… | |
316 | |
316 | |
317 | remove (pidfilename); |
317 | remove (pidfilename); |
318 | errno = 0; |
318 | errno = 0; |
319 | if (curr_uplink != NULL && curr_uplink->conn != NULL) |
319 | if (curr_uplink != NULL && curr_uplink->conn != NULL) |
320 | sendq_flush (curr_uplink->conn); |
320 | sendq_flush (curr_uplink->conn); |
321 | connection_close_all (); |
321 | connection_t::close_all (); |
322 | |
322 | |
323 | me.connected = false; |
323 | me.connected = false; |
324 | |
324 | |
325 | /* should we restart? */ |
325 | /* should we restart? */ |
326 | if (runflags & RF_RESTART) |
326 | if (runflags & RF_RESTART) |
… | |
… | |
337 | /* free used memory */ |
337 | /* free used memory */ |
338 | shstr::cleanup (); |
338 | shstr::cleanup (); |
339 | modules::cleanup (); |
339 | modules::cleanup (); |
340 | myuser_t::cleanup (); // XXX: this currently breaks and I don't know why |
340 | myuser_t::cleanup (); // XXX: this currently breaks and I don't know why |
341 | mynick_cleanup (); |
341 | mynick_cleanup (); |
342 | mychan_cleanup (); |
342 | mychan_t::cleanup (); |
343 | delete phandler; |
343 | delete phandler; |
344 | |
344 | |
345 | log_shutdown (); |
345 | log_shutdown (); |
346 | |
346 | |
347 | return 0; |
347 | return 0; |