mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #161898: Color management memory leak with curves enabled
Issue from 9d4b236d13.
Pull Request: https://projects.blender.org/blender/blender/pulls/162140
This commit is contained in:
parent
54f543e4c4
commit
f207c2ddf3
1 changed files with 13 additions and 2 deletions
|
|
@ -6,6 +6,7 @@
|
|||
* \ingroup imbuf
|
||||
*/
|
||||
|
||||
#include "BLI_utility_mixins.hh"
|
||||
#include "IMB_colormanagement.hh"
|
||||
#include "IMB_colormanagement_intern.hh"
|
||||
|
||||
|
|
@ -122,14 +123,24 @@ float3x3 global_scene_linear_to_xyz_default = float3x3::zero();
|
|||
*/
|
||||
static pthread_mutex_t processor_lock = BLI_MUTEX_INITIALIZER;
|
||||
|
||||
static struct GlobalGPUState {
|
||||
static struct GlobalGPUState : NonCopyable {
|
||||
GlobalGPUState() = default;
|
||||
|
||||
~GlobalGPUState()
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
void reset()
|
||||
{
|
||||
gpu_shader_bound = false;
|
||||
if (curve_mapping) {
|
||||
BKE_curvemapping_free(curve_mapping);
|
||||
curve_mapping = nullptr;
|
||||
}
|
||||
orig_curve_mapping = nullptr;
|
||||
use_curve_mapping = false;
|
||||
curve_mapping_timestamp = 0;
|
||||
}
|
||||
|
||||
/* GPU shader currently bound. */
|
||||
|
|
@ -348,7 +359,7 @@ void colormanagement_init()
|
|||
|
||||
void colormanagement_exit()
|
||||
{
|
||||
global_gpu_state = GlobalGPUState();
|
||||
global_gpu_state.reset();
|
||||
global_color_picking_state = GlobalColorPickingState();
|
||||
|
||||
colormanage_free_config();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue