Skip to content
Snippets Groups Projects
Commit ffbffd9e authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Fix crash

parent 9dcfab79
No related branches found
No related tags found
No related merge requests found
......@@ -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 */
......
......@@ -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;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment