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:
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user