* The code to handle AS_GET_SCREEN_ID_FROM_WINDOW did not lock the desktop,
which got unnoticed since the former Desktop::ActiveScreen() never changed. This fixes bug #4301. * Also fixed a possible deadlock on application crash with a kWindowScreenFeel window; the locking order of the Desktop's and the ServerApp's window lock was reversed. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32578 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -452,6 +452,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
case AS_APP_CRASHED:
|
case AS_APP_CRASHED:
|
||||||
// Allow the debugger to show its window: if needed, remove any
|
// Allow the debugger to show its window: if needed, remove any
|
||||||
// kWindowScreenFeels from the windows of this application
|
// kWindowScreenFeels from the windows of this application
|
||||||
|
if (fDesktop->LockAllWindows()) {
|
||||||
if (fWindowListLock.Lock()) {
|
if (fWindowListLock.Lock()) {
|
||||||
for (int32 i = fWindowList.CountItems(); i-- > 0;) {
|
for (int32 i = fWindowList.CountItems(); i-- > 0;) {
|
||||||
ServerWindow* serverWindow = fWindowList.ItemAt(i);
|
ServerWindow* serverWindow = fWindowList.ItemAt(i);
|
||||||
@@ -466,6 +467,8 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
|
|
||||||
fWindowListLock.Unlock();
|
fWindowListLock.Unlock();
|
||||||
}
|
}
|
||||||
|
fDesktop->UnlockAllWindows();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AS_CREATE_WINDOW:
|
case AS_CREATE_WINDOW:
|
||||||
@@ -2256,7 +2259,7 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
int32 clientToken;
|
int32 clientToken;
|
||||||
if (link.Read<int32>(&clientToken) != B_OK)
|
if (link.Read<int32>(&clientToken) != B_OK)
|
||||||
status = B_BAD_DATA;
|
status = B_BAD_DATA;
|
||||||
else {
|
else if (fDesktop->LockAllWindows()) {
|
||||||
BAutolock locker(fWindowListLock);
|
BAutolock locker(fWindowListLock);
|
||||||
|
|
||||||
for (int32 i = fWindowList.CountItems(); i-- > 0;) {
|
for (int32 i = fWindowList.CountItems(); i-- > 0;) {
|
||||||
@@ -2270,7 +2273,9 @@ ServerApp::_DispatchMessage(int32 code, BPrivate::LinkReceiver& link)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
fDesktop->UnlockAllWindows();
|
||||||
|
} else
|
||||||
|
status = B_ERROR;
|
||||||
|
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
fLink.StartMessage(status);
|
fLink.StartMessage(status);
|
||||||
@@ -2894,7 +2899,7 @@ ServerApp::_CreateWindow(int32 code, BPrivate::LinkReceiver& link,
|
|||||||
status = B_ERROR;
|
status = B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status < B_OK)
|
if (status != B_OK)
|
||||||
delete window;
|
delete window;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user