OSDN Git Service

Fixed issue #209: High CPU usage in tortoiseproc.exe & limit line number
authorFrank Li <lznuaa@gmail.com>
Fri, 23 Oct 2009 15:02:18 +0000 (23:02 +0800)
committerFrank Li <lznuaa@gmail.com>
Fri, 23 Oct 2009 15:02:18 +0000 (23:02 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/ProgressDlg.cpp

index 9dfc576..577f149 100644 (file)
@@ -288,9 +288,10 @@ void CProgressDlg::ParserCmdOutput(TCHAR ch)
                        m_Log.ReplaceSel(CString(_T("\r\n"))+m_LogText);\r
                }\r
                \r
-               if( lines >500 ) //limited log length\r
+               if( lines > 500 ) //limited log length\r
                {\r
-                       m_Log.SetSel(0,m_Log.LineLength(0));\r
+                       int end=m_Log.LineIndex(1);\r
+                       m_Log.SetSel(0,end);\r
                        m_Log.ReplaceSel(_T(""));\r
                }\r
                m_Log.LineScroll(m_Log.GetLineCount());\r