Skip to content

Commit 7cdb0d4

Browse files
committed
Some users of Async::Util::amap() might call the callback twice - ignore second call!
Signed-off-by: Michael Herger <michael@herger.net>
1 parent 566fbf4 commit 7cdb0d4

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/Async/Util.pm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ sub _amap {
7171
$after_work = sub {
7272
my ($output, $err, $index) = @_;
7373

74+
# prevent handling the same output twice - some misbehaving actions might call us twice!
75+
return if defined $outputs->[$index];
76+
7477
$cb_count++;
7578
$inflight--;
7679

0 commit comments

Comments
 (0)