summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorAlexander Gavriliuk <alexandrgproductengine@lindenlab.com>2024-07-06 09:23:39 +0200
committerGuru <alexandrgproductengine@lindenlab.com>2024-07-08 12:16:32 +0200
commitd0173ac7fc1f999b31aad70c3abfa2c57f872899 (patch)
treed2ff6b4ca21a1040e0144fff328b9cc22ca626ff /indra
parentd996497c5e0a45e1bc68a06f4d4cdab5f706a53b (diff)
#1931 Terminate AppViewer immediately in case of initialization failed
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llrendertarget.cpp4
-rw-r--r--indra/llrender/llrendertarget.h2
-rw-r--r--indra/newview/llappviewer.cpp45
3 files changed, 13 insertions, 38 deletions
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index 410efe9a70..60159a0497 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -50,7 +50,6 @@ void check_framebuffer_status()
}
}
-bool LLRenderTarget::sInitFailed = false;
bool LLRenderTarget::sUseFBO = false;
U32 LLRenderTarget::sCurFBO = 0;
@@ -353,9 +352,6 @@ void LLRenderTarget::release()
LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY;
llassert(!isBoundInStack());
- if (sInitFailed)
- return;
-
if (mDepth)
{
LLImageGL::deleteTextures(1, &mDepth);
diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h
index fc78f059e0..cd3290cf66 100644
--- a/indra/llrender/llrendertarget.h
+++ b/indra/llrender/llrendertarget.h
@@ -61,8 +61,6 @@
class LLRenderTarget
{
public:
- // Whether app initialization failed
- static bool sInitFailed;
// Whether or not to use FBO implementation
static bool sUseFBO;
static U32 sBytesAllocated;
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 968e863496..525bd31c72 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -723,19 +723,6 @@ public:
bool LLAppViewer::init()
{
- struct ResultHandler
- {
- bool success = false; // Should be set in case of successful result
- ~ResultHandler()
- {
- if (!success)
- {
- // Mark critical flags in case of unsuccessful initialization
- LLRenderTarget::sInitFailed = true;
- }
- }
- } result_handler;
-
setupErrorHandling(mSecondInstance);
//
@@ -766,8 +753,7 @@ bool LLAppViewer::init()
// inits from settings.xml and from strings.xml
if (!initConfiguration())
{
- LL_WARNS("InitInfo") << "initConfiguration() failed." << LL_ENDL;
- return false;
+ LL_ERRS("InitInfo") << "initConfiguration() failed." << LL_ENDL;
}
LL_INFOS("InitInfo") << "Configuration initialized." << LL_ENDL ;
@@ -921,9 +907,8 @@ bool LLAppViewer::init()
if (!initHardwareTest())
{
- LL_WARNS("InitInfo") << "initHardwareTest() failed." << LL_ENDL;
// Early out from user choice.
- return false;
+ LL_ERRS("InitInfo") << "initHardwareTest() failed." << LL_ENDL;
}
LL_INFOS("InitInfo") << "Hardware test initialization done." << LL_ENDL ;
@@ -937,11 +922,9 @@ bool LLAppViewer::init()
if (!initCache())
{
- LL_WARNS("InitInfo") << "Failed to init cache" << LL_ENDL;
- std::ostringstream msg;
- msg << LLTrans::getString("MBUnableToAccessFile");
- OSMessageBox(msg.str(),LLStringUtil::null,OSMB_OK);
- return false;
+ std::string msg = LLTrans::getString("MBUnableToAccessFile");
+ OSMessageBox(msg.c_str(), LLStringUtil::null, OSMB_OK);
+ LL_ERRS("InitInfo") << "Failed to init cache" << LL_ENDL;
}
LL_INFOS("InitInfo") << "Cache initialization is done." << LL_ENDL ;
@@ -970,11 +953,11 @@ bool LLAppViewer::init()
gGLManager.printGLInfoString();
// If we don't have the right GL requirements, exit.
+ // ? AG: It seems we never set mHasRequirements to false
if (!gGLManager.mHasRequirements)
{
- LL_WARNS("InitInfo") << "gGLManager.mHasRequirements is false." << LL_ENDL;
- // already handled with a MBVideoDrvErr
- return false;
+ // Already handled with a MBVideoDrvErr
+ LL_ERRS("InitInfo") << "gGLManager.mHasRequirements is false." << LL_ENDL;
}
// Without SSE2 support we will crash almost immediately, warn here.
@@ -982,11 +965,9 @@ bool LLAppViewer::init()
{
// can't use an alert here since we're exiting and
// all hell breaks lose.
- OSMessageBox(
- LLNotifications::instance().getGlobalString("UnsupportedCPUSSE2"),
- LLStringUtil::null,
- OSMB_OK);
- return false;
+ std::string msg = LLNotifications::instance().getGlobalString("UnsupportedCPUSSE2");
+ OSMessageBox(msg.c_str(), LLStringUtil::null, OSMB_OK);
+ LL_ERRS("InitInfo") << "SSE2 is not supported" << LL_ENDL;
}
// alert the user if they are using unsupported hardware
@@ -1012,12 +993,14 @@ bool LLAppViewer::init()
minSpecs += "\n";
unsupported = true;
}
+
if (gSysCPU.getMHz() < minCPU)
{
minSpecs += LLNotifications::instance().getGlobalString("UnsupportedCPU");
minSpecs += "\n";
unsupported = true;
}
+
if (gSysMemory.getPhysicalMemoryKB() < minRAM)
{
minSpecs += LLNotifications::instance().getGlobalString("UnsupportedRAM");
@@ -1299,8 +1282,6 @@ bool LLAppViewer::init()
}
#endif
- result_handler.success = true;
-
return true;
}