diff options
author | Edward <edward88> | 2022-10-21 16:35:20 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-10-21 16:35:30 +0300 |
commit | 4776a74bf7f1ed60efee22290c5fea732d7e2e5a (patch) | |
tree | de2b272b9b8efef6d1493fd7ca57c40a71c6518b /intern | |
parent | ec60c8abe76e4473f45d783010be92114c0ed608 (diff) |
Fix T101974: Potential memoryleak GHOST_WindowWayland.newDrawingContext
Reviewed By: jbakker
Maniphest Tasks: T101974
Differential Revision: https://developer.blender.org/D16309
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowWayland.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWayland.cpp b/intern/ghost/intern/GHOST_WindowWayland.cpp index b29c5efd8d4..986e18d7a87 100644 --- a/intern/ghost/intern/GHOST_WindowWayland.cpp +++ b/intern/ghost/intern/GHOST_WindowWayland.cpp @@ -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; } /** \} */ |