OSDN Git Service

Fix RefLogDlg crash
authorFrank Li <lznuaa@gmail.com>
Wed, 20 Jan 2010 14:24:45 +0000 (22:24 +0800)
committerFrank Li <lznuaa@gmail.com>
Wed, 20 Jan 2010 14:24:45 +0000 (22:24 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/LogDataVector.cpp
src/TortoiseProc/RefLogDlg.cpp

index fad928d..3e182d0 100644 (file)
@@ -246,12 +246,9 @@ int CLogDataVector::ParserFromRefLog(CString ref)
                        }\r
                }\r
 \r
-               if(this->m_pLogCache->m_HashMap.IsExist(rev.m_CommitHash))\r
-               {\r
-                       if(!this->m_pLogCache->m_HashMap[rev.m_CommitHash].m_IsFull)\r
-                               this->m_pLogCache->m_HashMap[rev.m_CommitHash].CopyFrom(rev);\r
-               }else\r
-                       this->m_pLogCache->m_HashMap[rev.m_CommitHash].CopyFrom(rev);\r
+               this->m_pLogCache->m_HashMap[rev.m_CommitHash]=rev;\r
+\r
+               this->push_back(rev.m_CommitHash);\r
 \r
        }\r
        return 0;\r
index ab0a31f..3de12cd 100644 (file)
@@ -95,6 +95,7 @@ void CRefLogDlg::OnCbnSelchangeRef()
        CString ref=m_ChooseRef.GetString();\r
        if(m_RefList.m_RefMap.find(ref) == m_RefList.m_RefMap.end())\r
        {\r
+               m_RefList.m_RefMap[ref].m_pLogCache = &m_RefList.m_LogCache;\r
                m_RefList.m_RefMap[ref].ParserFromRefLog(ref);\r
        }\r
        m_RefList.ClearText();\r
@@ -104,7 +105,6 @@ void CRefLogDlg::OnCbnSelchangeRef()
 \r
        CLogDataVector *plog;\r
        plog = &m_RefList.m_RefMap[ref];\r
-       plog->SetLogCache(&this->m_RefList.m_LogCache);\r
 \r
        m_RefList.SetItemCountEx(plog->size());\r
 \r
@@ -113,7 +113,7 @@ void CRefLogDlg::OnCbnSelchangeRef()
        for(unsigned int i=0;i<m_RefList.m_RefMap[ref].size();i++)\r
        {\r
                plog->GetGitRevAt(i).m_IsFull=TRUE;\r
-               this->m_RefList.m_arShownList.Add(&(plog->at(i)));\r
+               this->m_RefList.m_arShownList.Add(&(plog->GetGitRevAt(i)));\r
                \r
        }\r
 \r