From 57a6c095d5641559e59e4f175728c010e1da193a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Sat, 4 Feb 2006 20:19:13 +0000 Subject: [PATCH] Work-around to make broken apps like 3dmix work - patch submitted by genki-at-bredband.net: * we no longer drop into the debugger if BScreen is used without an app_server link. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16229 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/PrivateScreen.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/kits/interface/PrivateScreen.cpp b/src/kits/interface/PrivateScreen.cpp index 631c44851f..b9f09c6bd9 100644 --- a/src/kits/interface/PrivateScreen.cpp +++ b/src/kits/interface/PrivateScreen.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005, Haiku Inc. + * Copyright 2002-2006, Haiku Inc. * Distributed under the terms of the MIT License. * * Authors: @@ -7,9 +7,10 @@ * Axel Dörfler, axeld@pinc-software.de */ -/** BPrivateScreen is the class which does the real work for - * the proxy class BScreen (it interacts with the app server). - */ +/*! + BPrivateScreen is the class which does the real work for + the proxy class BScreen (it interacts with the app_server). +*/ #include "AppMisc.h" @@ -17,6 +18,7 @@ #include "PrivateScreen.h" #include "ServerProtocol.h" +#include #include #include #include @@ -65,6 +67,10 @@ BPrivateScreen::Get(screen_id id) BPrivateScreen * BPrivateScreen::_Get(screen_id id, bool check) { + // Nothing works without an app_server connection + if (be_app == NULL) + return NULL; + BAutolock locker(sScreenLock); // search for the screen ID