From 349dc120eb931e930b3205c10bb861340a704948 Mon Sep 17 00:00:00 2001 From: "pinkerton%netscape.com" Date: Mon, 14 Sep 1998 22:36:43 +0000 Subject: [PATCH] Fix bug where we would randomly crash in the RDF notification handler. We weren't properly disposing of the personal toolbar pane and so it would get events long after it was deleted, causing crashes. --- cmd/macfe/gui/CPersonalToolbarTable.cp | 12 +++++++++--- cmd/macfe/gui/CPersonalToolbarTable.h | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/cmd/macfe/gui/CPersonalToolbarTable.cp b/cmd/macfe/gui/CPersonalToolbarTable.cp index b00a50beca95..e3e7aa3e748b 100644 --- a/cmd/macfe/gui/CPersonalToolbarTable.cp +++ b/cmd/macfe/gui/CPersonalToolbarTable.cp @@ -63,10 +63,10 @@ CPersonalToolbarTable :: CPersonalToolbarTable ( LStream* inStream ) // setup our window into the RDF world and register this class as the one to be notified // when the personal toolbar changes. HT_Notification notifyStruct = CreateNotificationStruct(); - HT_Pane toolbarPane = HT_NewPersonalToolbarPane(notifyStruct); - if ( !toolbarPane ) + mToolbarPane = HT_NewPersonalToolbarPane(notifyStruct); + if ( !mToolbarPane ) throw SomethingBadInHTException(); - mToolbarView = HT_GetSelectedView ( toolbarPane ); + mToolbarView = HT_GetSelectedView ( mToolbarPane ); if ( !mToolbarView ) throw SomethingBadInHTException(); mToolbarRoot = HT_TopNode ( mToolbarView ); @@ -109,6 +109,12 @@ CPersonalToolbarTable :: ~CPersonalToolbarTable ( ) { delete mButtonList; + if ( mToolbarPane ) { + // we don't want to know about any events while we're being deleted! + HT_SetNotificationMask ( mToolbarPane, HT_EVENT_NO_NOTIFICATION_MASK ); + HT_DeletePane ( mToolbarPane ); + } + } // destructor diff --git a/cmd/macfe/gui/CPersonalToolbarTable.h b/cmd/macfe/gui/CPersonalToolbarTable.h index 49e37794b418..a920702d2213 100644 --- a/cmd/macfe/gui/CPersonalToolbarTable.h +++ b/cmd/macfe/gui/CPersonalToolbarTable.h @@ -158,7 +158,8 @@ class CPersonalToolbarTable : public LSmallIconTable, public LDragAndDrop, HT_View mToolbarView; HT_Resource mToolbarRoot; - + HT_Pane mToolbarPane; + ButtonList* mButtonList; // list of buttons pulled from HT bool mIsInitialized; // is this class ready for prime time?