summaryrefslogtreecommitdiffstats
path: root/messagebus/src/tests/replygate/replygate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'messagebus/src/tests/replygate/replygate.cpp')
-rw-r--r--messagebus/src/tests/replygate/replygate.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/messagebus/src/tests/replygate/replygate.cpp b/messagebus/src/tests/replygate/replygate.cpp
index 3de48fce130..c71993c9368 100644
--- a/messagebus/src/tests/replygate/replygate.cpp
+++ b/messagebus/src/tests/replygate/replygate.cpp
@@ -59,7 +59,7 @@ TEST("replygate_test") {
{
RoutableQueue q;
MySender sender;
- MyGate *gate = new MyGate(sender);
+ auto gate = vespalib::make_ref_counted<MyGate>(sender);
{
auto msg = std::make_unique<SimpleMessage>("test");
msg->pushHandler(q);
@@ -79,7 +79,7 @@ TEST("replygate_test") {
EXPECT_TRUE(MyReply::dtorCnt == 1);
EXPECT_TRUE(MyGate::ctorCnt == 1);
EXPECT_TRUE(MyGate::dtorCnt == 0);
- gate->subRef();
+ gate = vespalib::ref_counted<MyGate>();
EXPECT_TRUE(MyGate::ctorCnt == 1);
EXPECT_TRUE(MyGate::dtorCnt == 1);
}