From 40d830a4a3e225ea8819251c7c87a66eab0d46d0 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 11 Jun 2019 20:14:51 -0400 Subject: fix conn bug --- test_p2p_stress/main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test_p2p_stress/main.go') diff --git a/test_p2p_stress/main.go b/test_p2p_stress/main.go index ed671fc..ff7bd47 100644 --- a/test_p2p_stress/main.go +++ b/test_p2p_stress/main.go @@ -194,9 +194,10 @@ func onReceiveAck(_msg *C.struct_msg_t, _conn *C.struct_msgnetwork_conn_t, userd ctx := C.timeout_callback_context_new() ctx.app_id = C.int(id) ctx.addr_id = C.uint64_t(addr) - ctx.conn = (*C.struct_msgnetwork_conn_t)(conn) + ctx.conn = (*C.struct_msgnetwork_conn_t)(conn.Copy()) if tc.timer != nil { tc.timer.Free() + salticidae.MsgNetworkConn(tc.timer_ctx.conn).Free() C.free(unsafe.Pointer(tc.timer_ctx)) } tc.timer = salticidae.NewTimerEvent(app.ec, salticidae.TimerEventCallback(C.onTimeout), unsafe.Pointer(ctx)) -- cgit v1.2.3-70-g09d2