diff --git a/db/HGPdtToolDb/HGPdtToolDbImpl.cpp b/db/HGPdtToolDb/HGPdtToolDbImpl.cpp index 4984aa5..7ce2c7f 100644 --- a/db/HGPdtToolDb/HGPdtToolDbImpl.cpp +++ b/db/HGPdtToolDb/HGPdtToolDbImpl.cpp @@ -201,11 +201,18 @@ HGResult HGPdtToolDbUserMgrImpl::Create(const HGChar* host, HGUShort port, const HGResult HGPdtToolDbUserMgrImpl::Destroy() { - if (NULL == m_sql || !m_deviceList.empty()) + if (NULL == m_sql) { return HGBASE_ERR_FAIL; } + std::list::iterator iter; + for (iter = m_deviceList.begin(); iter != m_deviceList.end(); ++iter) + { + delete (*iter); + } + m_deviceList.clear(); + m_stopThread = HGTRUE; HGBase_SetEvent(m_event); HGBase_CloseThread(m_thread); @@ -693,7 +700,7 @@ HGResult HGPdtToolDbUserMgrImpl::DownloadFile(const HGChar* tag, const HGChar* f { if (readLength == fwrite(bnd.buffer, 1, bnd.buffer_length, file)) { - ret = HGBASE_ERR_OK; + res = HGBASE_ERR_OK; } fclose(file);