mirror of https://github.com/deavminet/dnetd.git
Fixed code whereby mutex would never be unlocked if channel was found
This commit is contained in:
parent
bf74c74891
commit
723d44aa1f
|
@ -131,6 +131,9 @@ public class DServer : Thread
|
|||
|
||||
public DChannel getChannelByName(string channelName)
|
||||
{
|
||||
/* The channel */
|
||||
DChannel channel = null;
|
||||
|
||||
/* Lock the channels list */
|
||||
channelLock.lock();
|
||||
|
||||
|
@ -138,14 +141,15 @@ public class DServer : Thread
|
|||
{
|
||||
if(cmp(currentChannel.getName(), channelName) == 0)
|
||||
{
|
||||
return currentChannel;
|
||||
channel = currentChannel;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Unlock the channels list */
|
||||
channelLock.unlock();
|
||||
|
||||
return null;
|
||||
return channel;
|
||||
}
|
||||
|
||||
public DChannel[] getChannels()
|
||||
|
|
Loading…
Reference in New Issue