static void destruct(struct core_stream *stream)
{
dc_sink_release(&stream->sink->public);
- if (stream->public.out_transfer_func != NULL)
+ if (stream->public.out_transfer_func != NULL) {
dc_transfer_func_release(
stream->public.out_transfer_func);
+ stream->public.out_transfer_func = NULL;
+ }
}
void dc_stream_retain(const struct dc_stream *dc_stream)
static void destruct(struct surface *surface)
{
- if (surface->protected.public.gamma_correction != NULL)
+ if (surface->protected.public.gamma_correction != NULL) {
dc_gamma_release(surface->protected.public.gamma_correction);
- if (surface->protected.public.in_transfer_func != NULL)
+ surface->protected.public.gamma_correction = NULL;
+ }
+ if (surface->protected.public.in_transfer_func != NULL) {
dc_transfer_func_release(
surface->protected.public.in_transfer_func);
+ surface->protected.public.in_transfer_func = NULL;
+ }
}
/*******************************************************************************