8000 Merge pull request #149 from clue-labs/cleanup · reactphp/event-loop@e03f114 · GitHub
[go: up one dir, main page]

Skip to content

Commit e03f114

Browse files
authored
Merge pull request #149 from clue-labs/cleanup
Properly clean up event watchers for ext-event and ext-libev
2 parents 502b4b6 + 0f8c6b4 commit e03f114

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/ExtEventLoop.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function ($signal) {
5757
},
5858
function ($signal) {
5959
if ($this->signals->count($signal) === 0) {
60-
$this->signalEvents[$signal]->del();
60+
$this->signalEvents[$signal]->free();
6161
unset($this->signalEvents[$signal]);
6262
}
6363
}

src/ExtLibevLoop.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ function ($signal) {
5555
},
5656
function ($signal) {
5757
if ($this->signals->count($signal) === 0) {
58+
$this->signalEvents[$signal]->stop();
5859
$this->loop->remove($this->signalEvents[$signal]);
5960
unset($this->signalEvents[$signal]);
6061
}
@@ -100,6 +101,7 @@ public function removeReadStream($stream)
100101

101102
if (isset($this->readEvents[$key])) {
102103
$this->readEvents[$key]->stop();
104+
$this->loop->remove($this->readEvents[$key]);
103105
unset($this->readEvents[$key]);
104106
}
105107
}
@@ -110,6 +112,7 @@ public function removeWriteStream($stream)
110112

111113
if (isset($this->writeEvents[$key])) {
112114
$this->writeEvents[$key]->stop();
115+
$this->loop->remove($this->writeEvents[$key]);
113116
unset($this->writeEvents[$key]);
114117
}
115118
}

0 commit comments

Comments
 (0)
0