TeamDebugger: - When a job is aborted, instead of calling into the user interface directly to reset the status message, post a message to do so. Also, only post the message if we aren't already in a terminating state. Otherwise, if jobs were still running while the team debugger is executing its destructor, it would attempt to make calls to the already destroyed user interface. This bug has likely been with us for quite some time, but was hidden by incorrect ref counting in the past (see #12343).
This commit is contained in:
@@ -60,7 +60,8 @@ enum {
|
||||
|
||||
MSG_GENERATE_DEBUG_REPORT = 'gdrp',
|
||||
MSG_DEBUG_INFO_NEEDS_USER_INPUT = 'dnui',
|
||||
MSG_USER_INTERFACE_FILE_CHOSEN = 'uifc'
|
||||
MSG_USER_INTERFACE_FILE_CHOSEN = 'uifc',
|
||||
MSG_RESET_USER_BACKGROUND_STATUS = 'rubs'
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -963,6 +963,12 @@ TeamDebugger::MessageReceived(BMessage* message)
|
||||
break;
|
||||
}
|
||||
|
||||
case MSG_RESET_USER_BACKGROUND_STATUS:
|
||||
{
|
||||
fUserInterface->NotifyBackgroundWorkStatus("Ready.");
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
BLooper::MessageReceived(message);
|
||||
break;
|
||||
@@ -2546,8 +2552,8 @@ TeamDebugger::_NotifyUser(const char* title, const char* text,...)
|
||||
void
|
||||
TeamDebugger::_ResetUserBackgroundStatusIfNeeded()
|
||||
{
|
||||
if (!fWorker->HasPendingJobs())
|
||||
fUserInterface->NotifyBackgroundWorkStatus("Ready.");
|
||||
if (!fTerminating && !fWorker->HasPendingJobs())
|
||||
PostMessage(MSG_RESET_USER_BACKGROUND_STATUS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user