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.

This commit is contained in:
pinkerton%netscape.com 1998-09-14 22:36:43 +00:00
Родитель 46f5ffb26f
Коммит 349dc120eb
2 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -158,6 +158,7 @@ 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?