this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Added more checks to FreeTarget() so targets won't be referenced by the context target after freeing.

+21 -3
+21 -3
src/renderer_GL_common.inl
··· 4110 4110 // Prepare to work in this target's context, if it has one 4111 4111 if(target == renderer->current_context_target) 4112 4112 renderer->impl->FlushBlitBuffer(renderer); 4113 - else if(target->context_target != NULL) 4113 + else if (target->context_target != NULL) 4114 + { 4114 4115 GPU_MakeCurrent(target->context_target, target->context_target->context->windowID); 4116 + } 4115 4117 4116 4118 4117 4119 // Release renderer data reference ··· 4130 4132 if(target == renderer->current_context_target) 4131 4133 renderer->current_context_target = NULL; 4132 4134 4133 - if(target->image != NULL && target->image->target == target) 4134 - target->image->target = NULL; 4135 + // Make sure this target is not referenced by the context 4136 + if (renderer->current_context_target != NULL) 4137 + { 4138 + GPU_CONTEXT_DATA* cdata = ((GPU_CONTEXT_DATA*)renderer->current_context_target->context_target->context->data); 4139 + // Clear reference to image 4140 + if (cdata->last_image == target->image) 4141 + cdata->last_image = NULL; 4142 + 4143 + if(target == renderer->current_context_target->context->active_target) 4144 + renderer->current_context_target->context->active_target = NULL; 4145 + } 4146 + 4147 + if (target->image != NULL) 4148 + { 4149 + // Make sure this is not targeted by an image that will persist 4150 + if (target->image->target == target) 4151 + target->image->target = NULL; 4152 + } 4135 4153 4136 4154 // Delete matrices 4137 4155 GPU_ClearMatrixStack(&target->projection_matrix);