Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a double free of imagecache and add a replace mode for add_file() #2021

Merged
merged 2 commits into from Oct 1, 2018

Conversation

aconty
Copy link
Contributor

@aconty aconty commented Oct 1, 2018

It is split in two commits, see the log. First one fixes a double free bug when the imagecache is provided to the texture system. The second is an option to make add_file() replace any existing entries. Useful for providing user buffers as textures that have already been queried (for instance to get a handle).

Now that we allow providing an external ImageCache to the texturesys,
destroy handles its destroying and it shouldn't be done in the
destructor.
Instead of assuming the present file is equivalent, nuke it and reset it
with the new parameters. This fixes a problem adding files after
somebody has asked for a handle. Also allow non mip-mapped files when
coming from user buffers.
@lgritz
Copy link
Collaborator

lgritz commented Oct 1, 2018

LGTM, thanks for the fixes. Merging.

@lgritz lgritz merged commit 4be05f8 into AcademySoftwareFoundation:master Oct 1, 2018
@lgritz
Copy link
Collaborator

lgritz commented Dec 29, 2018

Later realized that this fixes #1632.

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.

None yet

2 participants