diff options
Diffstat (limited to 'src/modules')
| -rw-r--r-- | src/modules/dcc/DccChatWindow.cpp | 14 | ||||
| -rw-r--r-- | src/modules/dcc/DccChatWindow.h | 7 |
2 files changed, 7 insertions, 14 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 diff --git a/src/modules/dcc/DccChatWindow.h b/src/modules/dcc/DccChatWindow.h index 54fb6556a..055dc089d 100644 --- a/src/modules/dcc/DccChatWindow.h +++ b/src/modules/dcc/DccChatWindow.h @@ -29,12 +29,14 @@ #include "DccWindow.h" #include "KviDataBuffer.h" -#include "KviPointerList.h" #include "KviThemedLabel.h" #include "KviCString.h" #include "KviWindow.h" #include "KviError.h" +#include <deque> +#include <memory> + #ifdef COMPILE_SSL_SUPPORT class KviSSL; #endif @@ -46,10 +48,9 @@ class DccChatThread : public DccThread { public: DccChatThread(KviWindow * wnd, kvi_socket_t fd); - ~DccChatThread(); protected: - KviPointerList<KviDataBuffer> * m_pOutBuffers; + std::deque<std::unique_ptr<KviDataBuffer>> m_pOutBuffers; protected: virtual void run(); |
