Moved arraylist remove to dvcman_close_channel

This ensures, that the resources are also cleaned up if no channel
listener was registered.
This commit is contained in:
Armin Novak 2015-01-21 14:16:23 +01:00
parent 256c64fbed
commit 2f57cca71c
1 changed files with 2 additions and 3 deletions

View File

@ -321,12 +321,9 @@ static int dvcman_write_channel(IWTSVirtualChannel* pChannel, UINT32 cbSize, BYT
static int dvcman_close_channel_iface(IWTSVirtualChannel* pChannel)
{
DVCMAN_CHANNEL* channel = (DVCMAN_CHANNEL*) pChannel;
DVCMAN* dvcman = channel->dvcman;
WLog_DBG(TAG, "id=%d", channel->channel_id);
ArrayList_Remove(dvcman->channels, channel);
return 1;
}
@ -430,6 +427,8 @@ int dvcman_close_channel(IWTSVirtualChannelManager* pChannelMgr, UINT32 ChannelI
ichannel->Close(ichannel);
}
ArrayList_Remove(dvcman->channels, channel);
return 0;
}