Tests: fix memory leak of GHOST system paths
Dispose of GHOST system paths when tearing down `BlendfileLoadingBaseTest` and some other test cases. This prevents a memory leak. A better solution would be to rework Blender's initialisation & teardown structure, but that's outside the scope of this fix. No functional changes to Blender.
This commit is contained in:
@@ -33,6 +33,8 @@
|
|||||||
|
|
||||||
#include "RNA_access.h"
|
#include "RNA_access.h"
|
||||||
|
|
||||||
|
#include "GHOST_Path-api.h"
|
||||||
|
|
||||||
namespace blender::bke::tests {
|
namespace blender::bke::tests {
|
||||||
|
|
||||||
TEST(view_layer, aov_unique_names)
|
TEST(view_layer, aov_unique_names)
|
||||||
@@ -94,6 +96,7 @@ TEST(view_layer, aov_unique_names)
|
|||||||
IMB_exit();
|
IMB_exit();
|
||||||
BKE_appdir_exit();
|
BKE_appdir_exit();
|
||||||
CLG_exit();
|
CLG_exit();
|
||||||
|
GHOST_DisposeSystemPaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_render_pass_conflict(Scene *scene,
|
static void test_render_pass_conflict(Scene *scene,
|
||||||
@@ -173,6 +176,7 @@ TEST(view_layer, aov_conflict)
|
|||||||
IMB_exit();
|
IMB_exit();
|
||||||
BKE_appdir_exit();
|
BKE_appdir_exit();
|
||||||
CLG_exit();
|
CLG_exit();
|
||||||
|
GHOST_DisposeSystemPaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace blender::bke::tests
|
} // namespace blender::bke::tests
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ set(INC
|
|||||||
../sequencer
|
../sequencer
|
||||||
../windowmanager
|
../windowmanager
|
||||||
../../../intern/clog
|
../../../intern/clog
|
||||||
|
../../../intern/ghost
|
||||||
../../../intern/guardedalloc
|
../../../intern/guardedalloc
|
||||||
|
|
||||||
# for writefile.c: dna_type_offsets.h
|
# for writefile.c: dna_type_offsets.h
|
||||||
|
|||||||
@@ -48,6 +48,8 @@
|
|||||||
#include "WM_api.h"
|
#include "WM_api.h"
|
||||||
#include "wm.h"
|
#include "wm.h"
|
||||||
|
|
||||||
|
#include "GHOST_Path-api.h"
|
||||||
|
|
||||||
#include "CLG_log.h"
|
#include "CLG_log.h"
|
||||||
|
|
||||||
void BlendfileLoadingBaseTest::SetUpTestCase()
|
void BlendfileLoadingBaseTest::SetUpTestCase()
|
||||||
@@ -93,6 +95,7 @@ void BlendfileLoadingBaseTest::TearDownTestCase()
|
|||||||
RNA_exit();
|
RNA_exit();
|
||||||
|
|
||||||
DEG_free_node_types();
|
DEG_free_node_types();
|
||||||
|
GHOST_DisposeSystemPaths();
|
||||||
DNA_sdna_current_free();
|
DNA_sdna_current_free();
|
||||||
BLI_threadapi_exit();
|
BLI_threadapi_exit();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user