Skip to content

Commit e12bec3

Browse files
liulanzhenglihuiba
authored andcommitted
ensure at_photon_fini executed in PooledDialer when photon init and finish twice
1 parent 55de15c commit e12bec3

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

net/http/client.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,13 @@ class PooledDialer {
4848
// multiple times, even for a thread_local instance. Therefore, ensure that there is no photon
4949
// thread switch inside the constructor. Place the initialization work in init() and ensure it
5050
// is initialized only once.
51-
PooledDialer() {
52-
photon::fini_hook({this, &PooledDialer::at_photon_fini});
53-
}
54-
5551
int init(TLSContext *_tls_ctx, std::vector<IPAddr> &src_ips) {
5652
if (initialized)
5753
return 0;
5854
SCOPED_LOCK(init_mtx);
5955
if (initialized)
6056
return 0;
57+
photon::fini_hook({this, &PooledDialer::at_photon_fini});
6158
tls_ctx = _tls_ctx;
6259
if (!tls_ctx) {
6360
tls_ctx_ownership = true;

0 commit comments

Comments
 (0)