If the looper is B_QUIT_REQUESTED synchronously. First quit and then send the reply message. Please check if this is the
correct semantics. I expected that the looper is dead when SendMessage returned. This should fix #7559 where the looper destructor has to be called before continuing the cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41821 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1206,6 +1206,10 @@ void
|
|||||||
BLooper::_QuitRequested(BMessage* message)
|
BLooper::_QuitRequested(BMessage* message)
|
||||||
{
|
{
|
||||||
bool isQuitting = QuitRequested();
|
bool isQuitting = QuitRequested();
|
||||||
|
int32 thread = fThread;
|
||||||
|
|
||||||
|
if (isQuitting)
|
||||||
|
Quit();
|
||||||
|
|
||||||
// We send a reply to the sender, when they're waiting for a reply or
|
// We send a reply to the sender, when they're waiting for a reply or
|
||||||
// if the request message contains a boolean "_shutdown_" field with value
|
// if the request message contains a boolean "_shutdown_" field with value
|
||||||
@@ -1216,12 +1220,9 @@ BLooper::_QuitRequested(BMessage* message)
|
|||||||
|| (message->FindBool("_shutdown_", &shutdown) == B_OK && shutdown)) {
|
|| (message->FindBool("_shutdown_", &shutdown) == B_OK && shutdown)) {
|
||||||
BMessage replyMsg(B_REPLY);
|
BMessage replyMsg(B_REPLY);
|
||||||
replyMsg.AddBool("result", isQuitting);
|
replyMsg.AddBool("result", isQuitting);
|
||||||
replyMsg.AddInt32("thread", fThread);
|
replyMsg.AddInt32("thread", thread);
|
||||||
message->SendReply(&replyMsg);
|
message->SendReply(&replyMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isQuitting)
|
|
||||||
Quit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user