| ☞ | Program
Repair Shop ![]() |
18 |
my $g = Guard->new("Fred");
my $a1 = Alarm->new;
$a1->add_observer($g);
$a1->notify_observers("I like pie!");
undef $a1;
my $a2 = Alarm->new;
$a2->notify_observers("I like pie!");
$a2 has no observers, so the final call should do nothing
But it happens to have the same hash key that $a1 did
So $g is notified anyway
This is hard to fix!
| ☞ | ![]() |
☞ |