Fixed bug that caused programs to crash when the default BTranslatorRoster is deleted, then the default BTranslatorRoster is used again

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1015 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matthew Wilber 2002-09-12 00:10:23 +00:00
parent 2be429a65d
commit 76bfea45a3

View File

@ -180,6 +180,12 @@ BTranslatorRoster::~BTranslatorRoster()
{
if (fSem > 0 && acquire_sem(fSem) == B_NO_ERROR) {
// If the default BTranslatorRoster is being
// deleted, set the pointer to the default
// BTranslatorRoster to NULL
if (fspDefaultTranslators == this)
fspDefaultTranslators = NULL;
// FIRST PASS: release BTranslator objects
translator_node *pTranNode = fpTranslators;
while (pTranNode) {