#!/usr/bin/perl
#use Mooix::Thing;
run sub ($) {
	my $this=shift;
	
	foreach my $obj (grep ref, $this->shutdownlist->list) {
		if ($this->background) {
			$obj->shutdown;
			exit;
		}
		# Give methods time to do their work.
		sleep 1;
	}

	foreach my $obj (grep ref, $this->sysshutdownlist->list) {
		$obj->shutdown;
	}
	
	# A little more time before the moo goes down.
	sleep 1;
}
