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
Notes: blender-bot 2023-02-14 00:57:33 +01:00
Referenced by issue #101974, Potential memoryleak `GHOST_WindowWayland.newDrawingContext`.
1 changed files with 6 additions and 1 deletions

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;
}
/** \} */