Fix (unreported) memleak in some BKE tests in multi-binaries case.

Some tests would access system paths somehow, which implicitely creates
the static `m_systemPaths` variable, but would not explicitely call
`GHOST_DisposeSystemPaths` at the end to release it.

Noticeable when disabling the `WITH_TESTS_SINGLE_BINARY` option.
This commit is contained in:
Bastien Montagne
2024-06-25 17:51:31 +02:00
parent b53ae4745c
commit fa2c7ccdda
3 changed files with 9 additions and 0 deletions

View File

@@ -5,6 +5,8 @@
#include "CLG_log.h"
#include "GHOST_Path-api.hh"
#include "BKE_appdir.hh"
#include "BKE_global.hh"
#include "BKE_idtype.hh"
@@ -80,6 +82,7 @@ class ImagePartialUpdateTest : public testing::Test {
IMB_moviecache_destruct();
IMB_exit();
GHOST_DisposeSystemPaths();
BKE_appdir_exit();
CLG_exit();
}

View File

@@ -7,6 +7,8 @@
#include "CLG_log.h"
#include "GHOST_Path-api.hh"
#include "DNA_constraint_types.h"
#include "DNA_mesh_types.h"
#include "DNA_node_types.h"
@@ -140,6 +142,7 @@ template<typename TestData> class Context {
bke::BKE_node_system_exit();
RNA_exit();
IMB_exit();
GHOST_DisposeSystemPaths();
BKE_appdir_exit();
CLG_exit();
}

View File

@@ -7,6 +7,8 @@
#include "CLG_log.h"
#include "GHOST_Path-api.hh"
#include "DNA_mesh_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
@@ -149,6 +151,7 @@ template<typename TestData> class Context {
RNA_exit();
IMB_exit();
BKE_appdir_exit();
GHOST_DisposeSystemPaths();
CLG_exit();
}
};