aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/dcc/DccChatWindow.cpp
diff options
context:
space:
mode:
authorGravatar staticfox2016-08-07 21:15:42 -0400
committerGravatar staticfox2016-08-07 23:12:47 -0400
commit71dff65c5aab342a5b60ade2dcb5d70e5aa1c8c5 (patch)
tree2cc9148ac4479d762dbf4649cd94824c9f81965c /src/modules/dcc/DccChatWindow.cpp
parentproxywidget: More cleanup (diff)
downloadKVIrc-71dff65c5aab342a5b60ade2dcb5d70e5aa1c8c5.tar.gz
KVIrc-71dff65c5aab342a5b60ade2dcb5d70e5aa1c8c5.tar.bz2
KVIrc-71dff65c5aab342a5b60ade2dcb5d70e5aa1c8c5.zip
DccChatWindow: Move to deque and unique pointers
Diffstat (limited to 'src/modules/dcc/DccChatWindow.cpp')
-rw-r--r--src/modules/dcc/DccChatWindow.cpp14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/modules/dcc/DccChatWindow.cpp b/src/modules/dcc/DccChatWindow.cpp
index eaf657e2f..54e8d042a 100644
--- a/src/modules/dcc/DccChatWindow.cpp
+++ b/src/modules/dcc/DccChatWindow.cpp
@@ -602,14 +602,6 @@ void DccChatWindow::connected()
DccChatThread::DccChatThread(KviWindow * wnd, kvi_socket_t fd)
: DccThread(wnd, fd)
{
- m_pOutBuffers = new KviPointerList<KviDataBuffer>;
- m_pOutBuffers->setAutoDelete(true);
-}
-
-DccChatThread::~DccChatThread()
-{
- if(m_pOutBuffers)
- delete m_pOutBuffers;
}
void DccChatThread::run()
@@ -821,7 +813,7 @@ bool DccChatThread::handleIncomingData(KviDccThreadIncomingData * data, bool bCr
void DccChatThread::sendRawData(const void * buffer, int len)
{
m_pMutex->lock();
- m_pOutBuffers->append(new KviDataBuffer((unsigned int)len, (const unsigned char *)buffer));
+ m_pOutBuffers.emplace_back(new KviDataBuffer((unsigned int)len, (const unsigned char *)buffer));
m_pMutex->unlock();
}
@@ -829,7 +821,7 @@ bool DccChatThread::tryFlushOutBuffers()
{
bool bRet = true;
m_pMutex->lock();
- while(KviDataBuffer * b = m_pOutBuffers->first())
+ for(auto & b : m_pOutBuffers)
{
int sentLen;
#ifdef COMPILE_SSL_SUPPORT
@@ -847,7 +839,7 @@ bool DccChatThread::tryFlushOutBuffers()
if(sentLen > 0)
{
if(sentLen == b->size())
- m_pOutBuffers->removeFirst();
+ m_pOutBuffers.pop_front();
else
{
// just a part