Skip to content

Don't double-free mat.texture - #506

Merged
dmurdoch merged 2 commits into
dmurdoch:masterfrom
MichaelChirico:patch-1
Jun 22, 2026
Merged

Don't double-free mat.texture#506
dmurdoch merged 2 commits into
dmurdoch:masterfrom
MichaelChirico:patch-1

Conversation

@MichaelChirico

Copy link
Copy Markdown
Contributor

mat.texture = NULL itself does mat.texture->unref():

Ref& operator = (T* in_ptr) { if (ptr) ptr->unref(); ptr = in_ptr; if (ptr) ptr->ref(); return *this; }

So this is actually a double-free.

This was flagged by ThreadSanitizer on clang.

@dmurdoch
dmurdoch merged commit ed15c4d into dmurdoch:master Jun 22, 2026
5 checks passed
@MichaelChirico
MichaelChirico deleted the patch-1 branch June 22, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants