Skip to content

Commit 936fe55

Browse files
committed
Cleanup and add HttpSM destructor
1 parent e9489e2 commit 936fe55

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

include/proxy/http/HttpSM.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ class HttpSM : public Continuation, public PluginUserArgs<TS_USER_ARGS_TXN>
187187

188188
public:
189189
HttpSM();
190-
void cleanup();
190+
~HttpSM() override;
191191
virtual void destroy();
192192

193193
static HttpSM *allocate();

include/proxy/http/HttpTransact.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,8 @@ class HttpTransact
849849
// memset((void *)&host_db_info, 0, sizeof(host_db_info));
850850
}
851851

852+
~State() { destroy(); }
853+
852854
void
853855
destroy()
854856
{
@@ -877,7 +879,6 @@ class HttpTransact
877879
url_map.clear();
878880
arena.reset();
879881
unmapped_url.clear();
880-
dns_info.~ResolveInfo();
881882
outbound_conn_track_state.clear();
882883

883884
delete[] ranges;

src/proxy/http/HttpSM.cc

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,8 @@ HttpSM::get_server_connect_timeout()
251251

252252
HttpSM::HttpSM() : Continuation(nullptr), vc_table(this) {}
253253

254-
void
255-
HttpSM::cleanup()
254+
HttpSM::~HttpSM()
256255
{
257-
t_state.destroy();
258-
api_hooks.clear();
259256
http_parser_clear(&http_parser);
260257

261258
HttpConfig::release(t_state.http_config_param);
@@ -280,7 +277,6 @@ HttpSM::cleanup()
280277
void
281278
HttpSM::destroy()
282279
{
283-
cleanup();
284280
THREAD_FREE(this, httpSMAllocator, this_thread());
285281
}
286282

src/proxy/http/remap/unit-tests/nexthop_test_stubs.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@
3232
#include "proxy/http/HttpSM.h"
3333
#include "nexthop_test_stubs.h"
3434

35+
int ParentConfig::m_id = 0;
36+
3537
HttpSM::HttpSM() : Continuation(nullptr), vc_table(this) {}
36-
void
37-
HttpSM::cleanup()
38-
{
39-
}
38+
HttpSM::~HttpSM() {}
4039
void
4140
HttpSM::destroy()
4241
{

0 commit comments

Comments
 (0)