#!/usr/bin/perl
#use Mooix::Thing;
#use Mooix::Root;
run sub {
	my $this=shift;
	
	if ($this->candestroy) {
		# Unregister from heartbeat.
		$Mooix::Root->system->heartbeat->remove(item => $this->item);
		
		return $this->super(@_);
	}
	else {
		return 1; # failure
	}
}
