diff options
| author | Michael Meeks <michael.meeks@collabora.com> | 2015-06-20 12:46:31 +0100 | 
|---|---|---|
| committer | Michael Meeks <michael.meeks@collabora.com> | 2015-06-20 15:00:30 +0100 | 
| commit | ffc08eac223211d3ca2d4ebadb9ccb8e26d22a5e (patch) | |
| tree | f89e10be6f0700e4b4e4b4b5c00c0bd5209c6b4a | |
| parent | 88b77c0b1866db0d729cc2c15b5d8d4f01e9630d (diff) | |
tdf#92166 - dispose the SwSrcEditWindow properly.
Also improve dispose method to cleanup various pointers.
Also avoid crash on post dispose MouseUp event.
Change-Id: Ic337a8306566d5b5c81b939be6f89f34fbcc5847
| -rw-r--r-- | sw/source/uibase/docvw/srcedtw.cxx | 17 | ||||
| -rw-r--r-- | sw/source/uibase/uiview/srcview.cxx | 2 | 
2 files changed, 15 insertions, 4 deletions
| diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index eb9dbf4b5259..c15e72dda1a7 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/uibase/docvw/srcedtw.cxx @@ -283,13 +283,18 @@ void SwSrcEditWindow::dispose()          n->removePropertiesChangeListener(listener_.get());      }      aSyntaxIdle.Stop(); +    if ( pOutWin ) +        pOutWin->SetTextView( NULL ); +      if ( pTextEngine )      {          EndListening( *pTextEngine );          pTextEngine->RemoveView( pTextView );          delete pTextView; +        pTextView = NULL;          delete pTextEngine; +        pTextEngine = NULL;      }      pHScrollbar.disposeAndClear();      pVScrollbar.disposeAndClear(); @@ -399,10 +404,14 @@ void  TextViewOutWin::MouseButtonUp( const MouseEvent &rEvt )      if ( pTextView )      {          pTextView->MouseButtonUp( rEvt ); -        SfxBindings& rBindings = static_cast<SwSrcEditWindow*>(GetParent())->GetSrcView()->GetViewFrame()->GetBindings(); -        rBindings.Invalidate( SID_TABLE_CELL ); -        rBindings.Invalidate( SID_CUT ); -        rBindings.Invalidate( SID_COPY ); +        SfxViewFrame *pFrame = static_cast<SwSrcEditWindow*>(GetParent())->GetSrcView()->GetViewFrame(); +        if ( pFrame ) +        { +            SfxBindings& rBindings = pFrame->GetBindings(); +            rBindings.Invalidate( SID_TABLE_CELL ); +            rBindings.Invalidate( SID_CUT ); +            rBindings.Invalidate( SID_COPY ); +        }      }  } diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index b29c8975a0b3..db8aeba32fd3 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -243,6 +243,8 @@ SwSrcView::~SwSrcView()                              (delay != 0) || !url.isEmpty());      EndListening(*pDocShell);      delete pSearchItem; + +    aEditWin.disposeAndClear();  }  void SwSrcView::SaveContentTo(SfxMedium& rMed) | 
