Fix: Memory Leak When Using Compositor.

When using the compositor inlined static vectors could allocate
memory. This memory wasn't freed. This patch would make them inline
again.
This commit is contained in:
Jeroen Bakker 2021-03-24 11:56:58 +01:00
parent 715c746296
commit 26b45448ab
Notes: blender-bot 2023-02-14 09:29:42 +01:00
Referenced by issue #86980, Sculpting: Multiresolution visual issue with smooth brush
Referenced by issue #86920, Edit Mode: Not all faces within the selection tools' bounds are being selected.
Referenced by issue #86914, Crash when selecting an object in Sculpt Mode
Referenced by issue #86871, Crash with to_mesh() on tapered bezier curve
1 changed files with 6 additions and 4 deletions

View File

@ -284,12 +284,13 @@ static void opencl_deinitialize()
{
/* Deinitialize OpenCL GPU's. */
if (g_work_scheduler.opencl.initialized) {
Device *device;
while (!g_work_scheduler.opencl.devices.is_empty()) {
device = g_work_scheduler.opencl.devices.pop_last();
Device *device = g_work_scheduler.opencl.devices.pop_last();
device->deinitialize();
delete device;
}
g_work_scheduler.opencl.devices.clear_and_make_inline();
if (g_work_scheduler.opencl.program) {
clReleaseProgram(g_work_scheduler.opencl.program);
g_work_scheduler.opencl.program = nullptr;
@ -397,12 +398,13 @@ static void threading_model_queue_deinitialize()
{
/* deinitialize CPU threads */
if (g_work_scheduler.queue.initialized) {
Device *device;
while (!g_work_scheduler.queue.devices.is_empty()) {
device = g_work_scheduler.queue.devices.pop_last();
Device *device = g_work_scheduler.queue.devices.pop_last();
device->deinitialize();
delete device;
}
g_work_scheduler.queue.devices.clear_and_make_inline();
BLI_thread_local_delete(g_thread_device);
g_work_scheduler.queue.initialized = false;
}