diff options
| author | Joel Klinghed <the_jk@yahoo.com> | 2017-07-25 22:55:27 +0200 |
|---|---|---|
| committer | Joel Klinghed <the_jk@yahoo.com> | 2017-07-25 22:55:27 +0200 |
| commit | 9ae48fac3ba4592a2257618f0ff5b1ce528499d8 (patch) | |
| tree | 142c025f15687f88e79804ebce04ec53c345504b | |
| parent | c729d3b38ea241af6c1cd0561cecb115239d4f55 (diff) | |
Close client and monitor connections completely when destroying proxy
Otherwise looper->remove() was not called, among other things
| -rw-r--r-- | src/proxy.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/proxy.cc b/src/proxy.cc index bd90567..522454a 100644 --- a/src/proxy.cc +++ b/src/proxy.cc @@ -271,6 +271,17 @@ public: setup(); } ~ProxyImpl() override { + while (true) { + auto it = clients_.begin(); + if (it == clients_.end()) break; + close_client(it.index()); + } + while (true) { + auto it = monitors_.begin(); + if (it == monitors_.end()) break; + close_monitor(it.index()); + } + if (accept_socket_) { looper_->remove(accept_socket_.get()); } |
