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

stonesense crashes after unload/reload #112

Open
ab9rf opened this issue Dec 24, 2024 · 2 comments
Open

stonesense crashes after unload/reload #112

ab9rf opened this issue Dec 24, 2024 · 2 comments

Comments

@ab9rf
Copy link
Member

ab9rf commented Dec 24, 2024

If one closes stonesense, unloads the stonesense plugin, reloads it (with or without rebuild), and reopens stonesense, stonesense crashes

@myk002
Copy link
Member

myk002 commented Jan 18, 2025

does this still happen after the cleanup? I've been able to reload the plugin and run it successfully on Linux

@ab9rf
Copy link
Member Author

ab9rf commented Jan 19, 2025

Still crashes on Windows, while trying to display the splash image. Interestingly, on reload the plugin does not attempt to reload the splash image; it uses the bitmap that was "previously loaded".

My guess is that Allegro doesn't properly release GDI, GPU, or DirectX resources, which prevents the DLL from unloading, and so the call to FreeLibrary doesn't actually free the library, so when it's reloaded DllMain is not called again to reinitialize global statics, leaving the plugin in an inconsistent state.

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

2 participants