Immediately close app_server window after pressing close button in R5

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14564 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adi Oanca 2005-10-29 10:35:09 +00:00
parent 9f0d28e921
commit a577cf141f

View File

@ -159,15 +159,20 @@ RootLayer::~RootLayer()
{
fQuiting = true;
// BMessage quitMsg(B_QUIT_REQUESTED);
BMessage quitMsg(B_QUIT_REQUESTED);
ssize_t length = quitMsg.FlattenedSize();
char buffer[length];
if (quitMsg.Flatten(buffer,length) < B_OK) {
// failed to flatten?
kill_thread(fThreadID);
}
else{
write_port(fListenPort, 0, buffer, length);
// BPrivate::PortLink msg(fListenPort, -1);
// msg.StartMessage(B_QUIT_REQUESTED);
// msg.EndMessage();
// msg.Flush();
status_t dummy;
wait_for_thread(fThreadID, &dummy);
}
status_t dummy;
wait_for_thread(fThreadID, &dummy);
delete fDragMessage;