Fix T101974: Potential memoryleak GHOST_WindowWayland.newDrawingContext

Reviewed By: jbakker

Maniphest Tasks: T101974

Differential Revision: https://developer.blender.org/D16309
This commit is contained in:
Edward
2022-10-21 15:35:20 +02:00
committed by Jeroen Bakker
parent ec60c8abe7
commit 4776a74bf7

View File

@@ -946,7 +946,12 @@ GHOST_Context *GHOST_WindowWayland::newDrawingContext(GHOST_TDrawingContextType
EGL_OPENGL_API);
}
return (context->initializeDrawingContext() == GHOST_kSuccess) ? context : nullptr;
if (context->initializeDrawingContext()) {
return context;
}
delete context;
return nullptr;
}
/** \} */