diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 1fd4399cadc9f81845c951c07f6769d2a86c3274..59bf7e963b3e5cee65d59b6867227fadf56d9261 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -830,6 +830,7 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B LL_WARNS() << "We're not running under any known WM. SDL Err: " << SDL_GetError() << LL_ENDL; } + if (gGLManager.mVRAM == 0) { gGLManager.mVRAM = x11_detect_VRAM_kb() / 1024; if (gGLManager.mVRAM != 0) @@ -2330,18 +2331,18 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ S32 rtn = OSBTN_CANCEL; U32 messagetype = SDL_MESSAGEBOX_INFORMATION; - const SDL_MessageBoxButtonData buttons_ok [] = { + static const SDL_MessageBoxButtonData buttons_ok [] = { /* .flags, .buttonid, .text */ { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, OSBTN_OK, "Ok" }, }; - const SDL_MessageBoxButtonData buttons_okcancel [] = { + static const SDL_MessageBoxButtonData buttons_okcancel [] = { /* .flags, .buttonid, .text */ { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, OSBTN_OK, "Ok" }, { SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, OSBTN_CANCEL, "Cancel" }, }; - const SDL_MessageBoxButtonData buttons_yesno [] = { + static const SDL_MessageBoxButtonData buttons_yesno [] = { /* .flags, .buttonid, .text */ { SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT, OSBTN_YES, "Yes" }, { SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, OSBTN_NO, "No" }, @@ -2369,7 +2370,7 @@ S32 OSMessageBoxSDL(const std::string& text, const std::string& caption, U32 typ const SDL_MessageBoxData messageboxdata = { messagetype, /* .flags */ - gWindowImplementation->getSDLWindow(), /* .window */ + gWindowImplementation ? gWindowImplementation->getSDLWindow() : nullptr, /* .window */ caption.c_str(), /* .title */ text.c_str(), /* .message */ num_buttons, /* .numbuttons */ diff --git a/indra/llwindow/llwindowsdl.h b/indra/llwindow/llwindowsdl.h index 30c4f4adbcfa51aa9ebd8269ecda23efb45efe90..fee9fc5a38c0e22890bc79d11adf16478078314a 100644 --- a/indra/llwindow/llwindowsdl.h +++ b/indra/llwindow/llwindowsdl.h @@ -152,7 +152,7 @@ class LLWindowSDL final : public LLWindow // by non-class code and it's better than making them global. #if LL_X11 Window mSDL_XWindowID; - Display *mSDL_Display; + Display *mSDL_Display = nullptr; #endif #if LL_GTK @@ -205,8 +205,8 @@ class LLWindowSDL final : public LLWindow // U32 mGrabbyKeyFlags; int mReallyCapturedCount; - SDL_Window* mWindow; - SDL_GLContext mGLContext; + SDL_Window* mWindow = nullptr; + SDL_GLContext mGLContext = nullptr; std::string mWindowName; std::string mWindowTitle; double mOriginalAspectRatio; @@ -240,7 +240,7 @@ class LLWindowSDL final : public LLWindow #endif bool mLanguageTextInputAllowed; - LLPreeditor* mPreeditor; + LLPreeditor* mPreeditor = nullptr; };