$OpenBSD: patch-kword_kwview_cc,v 1.1 2003/01/28 12:36:45 espie Exp $
--- kword/kwview.cc.orig	Mon Dec  2 22:06:02 2002
+++ kword/kwview.cc	Tue Jan 28 13:31:17 2003
@@ -251,12 +251,6 @@ KWView::KWView( KWViewMode* viewMode, QW
 KWView::~KWView()
 {
     clearSelection();
-    //delete special char dlg when we close view
-    if ( m_specialCharDlg )
-    {
-        m_specialCharDlg->closeDialog();
-    }
-
     if ( m_findReplace )
     {
         // Abort any find/replace
@@ -322,8 +316,11 @@ void KWView::clearSelection()
         delete m_spell.kspell;
     }
     delete m_searchEntry;
+    m_searchEntry = 0L;
     delete m_replaceEntry;
-    delete m_specialCharDlg;
+    m_replaceEntry = 0L;
+    if ( m_specialCharDlg )
+        m_specialCharDlg->closeDialog(); // will call slotSpecialCharDlgClosed
 }
 
 
@@ -3079,7 +3076,7 @@ void KWView::slotSpecialCharDlgClosed()
                     this, SLOT(slotSpecialChar(QChar,const QString &)));
         disconnect( m_specialCharDlg, SIGNAL( finished() ),
                     this, SLOT( slotSpecialCharDlgClosed() ) );
-        delete m_specialCharDlg;
+        m_specialCharDlg->deleteLater();
         m_specialCharDlg = 0L;
     }
 }
