OSDN Git Service

BUG: [ 1505763 ] Crash after closing file compare window
authorKimmo Varis <kimmov@gmail.com>
Tue, 20 Jun 2006 13:53:06 +0000 (13:53 +0000)
committerKimmo Varis <kimmov@gmail.com>
Tue, 20 Jun 2006 13:53:06 +0000 (13:53 +0000)
Src/Changes.txt
Src/MergeEditView.cpp

index 296ccf8..0feb40e 100644 (file)
@@ -2,6 +2,10 @@ Src\Changes.txt
 Add new items to top.
 (This summarizes all changes to all files under Src, including Src\Languages.)
 
+2006-06-20 Kimmo
+ BUG: [ 1505763 ] Crash after closing file compare window
+  Src: MergeEditView.cpp
+
 2006-06-19 Gal
  RFE: [ 1499245 ] Ruby Syntax Highlighting
   Src: Merge.dsp
@@ -15,7 +19,7 @@ Add new items to top.
  BUG: [ 1486434 ] Copy Pathnames for right-only dir copies parent dir only
   Src: DirView.cpp
 
-2006-05-31
+2006-05-31 Kimmo
  PATCH: [ 1483544 ] New compare method: by date and size
   Src: DiffWrapper.h DirScan.cpp Merge.rc PropCompare.cpp resource.h
   Src/Languages/*: Merge*.rc
index 41e2c93..41feca0 100644 (file)
@@ -2521,25 +2521,14 @@ void CMergeEditView::GotoLine(UINT nLine, BOOL bRealLine, int pane)
 }
 
 /**
- * @brief Called when user selects Window/Close, allows user to save files.
+ * @brief Called when user selects Window/Close.
+ * Route closing to CMainFrame::OnClose().
+ * @todo We probably should just remove this OnClose() handling for
+ *  CMergeEditView and handle it in CMainFrame.
  */
 void CMergeEditView::OnWindowClose()
 {
-       CMergeDoc *pDoc = GetDocument();
-
-       // Allow user to cancel closing
-       if (!pDoc->PromptAndSaveIfNeeded(TRUE))
-       {
-               return;
-       }
-       else
-       {
-               // Set modified to false so we don't ask again about saving
-               pDoc->m_ptBuf[0]->SetModified(FALSE);
-               pDoc->m_ptBuf[1]->SetModified(FALSE);
-               GetParentFrame()->PostMessage(WM_CLOSE, 0, 0);
-       }
-       m_pLocationView = NULL;
+       GetParentFrame()->PostMessage(WM_CLOSE, 0, 0);
 }
 
 /**
@@ -2964,6 +2953,9 @@ void CMergeEditView::SetLocationView(HWND hView,
 void CMergeEditView::UpdateLocationViewPosition(int nTopLine /*=-1*/,
                int nBottomLine /*= -1*/)
 {
+       if (m_pDocument == NULL)
+               return;
+
        if (m_hLocationview != NULL && IsWindow(m_hLocationview))
        {
                m_pLocationView->UpdateVisiblePos(nTopLine, nBottomLine);