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

Cached Pixmap Crash Fix #75

Merged
merged 2 commits into from
Jun 25, 2019
Merged

Cached Pixmap Crash Fix #75

merged 2 commits into from
Jun 25, 2019

Conversation

RobertBColton
Copy link
Contributor

@RobertBColton RobertBColton commented Jun 25, 2019

Ok, so I learned a hard lesson today. For a few months I have been confusing temporaries with locals. It is never ok to return a reference to a local variable! Constant qualification only extends the lifetime of temporary objects, not local variables. Simple solution here was to just make the invalid pixmap returned by cached pixmap a static local. This seems to fix crashes for me in the room editor when there are objects with no sprite.

@RobertBColton RobertBColton requested a review from polygoned June 25, 2019 00:34
@RobertBColton RobertBColton merged commit 78adb67 into master Jun 25, 2019
@RobertBColton RobertBColton deleted the pixmap-cache-crash-fix branch June 25, 2019 00:54
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