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

Crash on close / relaunch with some plugins #397

Closed
ggcrunchy opened this issue May 26, 2022 · 1 comment
Closed

Crash on close / relaunch with some plugins #397

ggcrunchy opened this issue May 26, 2022 · 1 comment

Comments

@ggcrunchy
Copy link
Contributor

Hi.

I'd submit this as a PR, but my fork is a mess, so this might be quickest. It only seems to need a very small fix.

The problem is first mentioned here and again further down. I'm fairly certain I've seen this issue in my own plugins, where they use external textures.

It's basically an ownership issue. During a close or relaunch, the arrays here wrongly tidy up resources they hold, even though those should only be transient, so with some unlucky timing you'll get double-frees. Basically, you have to be creating or updating a resource on the final frame; I suppose this must mean the issue can happen more generally--complete with mysterious bug reports in the past 😃--but the frequent updates in these sorts of plugins ramp up the probability.

The problem seems to be resolved by replacing the linked line and the next one thus:

		LightPtrArray<CPUResource> fCreateQueue;
		LightPtrArray<CPUResource> fUpdateQueue;

Without analyzing it too deeply, I think theGPUResource* array (fDestroyQueue) is fine, since its contents were after all queued to be destroyed.

zero-meta added a commit to zero-meta/corona that referenced this issue May 26, 2022
@ggcrunchy
Copy link
Contributor Author

Submitted a PR, so closing.

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

No branches or pull requests

1 participant