fix some valgrind conditional jump relies on uninit warnings

This commit is contained in:
Jupeyy 2022-12-04 22:54:18 +01:00
parent 552d60ee2f
commit 2fe7912b1f
2 changed files with 6 additions and 5 deletions

View file

@ -1258,7 +1258,8 @@ int CGraphicsBackend_SDL_GL::Shutdown()
delete m_pProcessor;
m_pProcessor = nullptr;
SDL_GL_DeleteContext(m_GLContext);
if(m_GLContext != nullptr)
SDL_GL_DeleteContext(m_GLContext);
SDL_DestroyWindow(m_pWindow);
SDL_QuitSubSystem(SDL_INIT_VIDEO);

View file

@ -111,8 +111,8 @@ struct SBackendCapabilites
class CCommandProcessorFragment_SDL
{
// SDL stuff
SDL_Window *m_pWindow;
SDL_GLContext m_GLContext;
SDL_Window *m_pWindow = nullptr;
SDL_GLContext m_GLContext = nullptr;
public:
enum
@ -169,8 +169,8 @@ static constexpr size_t gs_GPUInfoStringSize = 256;
// graphics backend implemented with SDL and the graphics library @see EBackendType
class CGraphicsBackend_SDL_GL : public CGraphicsBackend_Threaded
{
SDL_Window *m_pWindow = NULL;
SDL_GLContext m_GLContext;
SDL_Window *m_pWindow = nullptr;
SDL_GLContext m_GLContext = nullptr;
ICommandProcessor *m_pProcessor = nullptr;
std::atomic<uint64_t> m_TextureMemoryUsage{0};
std::atomic<uint64_t> m_BufferMemoryUsage{0};