DrawManager: Fixed memory leak in test cases

Memory leak is introduced as test cases reinitializes the GPU stack.
Added a call to GPU_backend_exit to fix this.

In GPU_backend_exit the GPU backend was destroyed but the pointer wasn't
reset for reuse. This patch also clears the pointer to be reused.
This commit is contained in:
Jeroen Bakker
2020-09-08 10:40:30 +02:00
parent 489aeabb9e
commit 0d68f55789
2 changed files with 2 additions and 0 deletions
@@ -37,6 +37,7 @@ class DrawTest : public ::testing::Test {
void TearDown() override
{
GPU_exit();
GPU_backend_exit();
GPU_context_discard(context);
GHOST_DisposeOpenGLContext(ghost_system, ghost_context);
GHOST_DisposeSystem(ghost_system);
+1
View File
@@ -185,6 +185,7 @@ void GPU_backend_exit(void)
/* TODO assert no resource left. Currently UI textures are still not freed in their context
* correctly. */
delete g_backend;
g_backend = NULL;
}
GPUBackend *GPUBackend::get(void)