Commit dae30652 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

rpcrt4: Remove connection from list in RPCRT4_ReleaseConnection.

parent 812897c8
......@@ -91,6 +91,7 @@ typedef struct _RpcConnection
RPC_SYNTAX_IDENTIFIER ActiveInterface;
USHORT NextCallId;
struct list protseq_entry;
struct _RpcServerProtseq *protseq;
struct _RpcBinding *server_binding;
} RpcConnection;
......
......@@ -227,6 +227,7 @@ static RPC_STATUS rpcrt4_protseq_ncalrpc_open_endpoint(RpcServerProtseq* protseq
EnterCriticalSection(&protseq->cs);
list_add_head(&protseq->listeners, &Connection->protseq_entry);
Connection->protseq = protseq;
LeaveCriticalSection(&protseq->cs);
return r;
......@@ -288,6 +289,7 @@ static RPC_STATUS rpcrt4_protseq_ncacn_np_open_endpoint(RpcServerProtseq *protse
EnterCriticalSection(&protseq->cs);
list_add_head(&protseq->listeners, &Connection->protseq_entry);
Connection->protseq = protseq;
LeaveCriticalSection(&protseq->cs);
return r;
......@@ -1323,6 +1325,7 @@ static RPC_STATUS rpcrt4_protseq_ncacn_ip_tcp_open_endpoint(RpcServerProtseq *pr
EnterCriticalSection(&protseq->cs);
list_add_tail(&protseq->listeners, &tcpc->common.protseq_entry);
tcpc->common.protseq = protseq;
LeaveCriticalSection(&protseq->cs);
freeaddrinfo(ai);
......@@ -3343,6 +3346,13 @@ RPC_STATUS RPCRT4_ReleaseConnection(RpcConnection* Connection)
/* server-only */
if (Connection->server_binding) RPCRT4_ReleaseBinding(Connection->server_binding);
if (Connection->protseq)
{
EnterCriticalSection(&Connection->protseq->cs);
list_remove(&Connection->protseq_entry);
LeaveCriticalSection(&Connection->protseq->cs);
}
HeapFree(GetProcessHeap(), 0, Connection);
return RPC_S_OK;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment