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

Fixed reinitialization of the window resize event thread #1617

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

kwellwood
Copy link
Contributor

This merge fixes a problem that occurs when initializing and running allegro multiple times in the same application session on Windows, i.e. during unit testing.

Vars end_resize_event_thread and resize_event_thread_ended were uninitialized in _al_win_init_window(). This prevented the resize event thread from running a second time because (end_resize_event_thread == true) as soon as it began.

Vars end_resize_event_thread and resize_event_thread_ended were uninitialized in init. This prevented the resize event thread from running a second time if allegro was shutdown and then initialized again in the same application run.
@pedro-w
Copy link
Contributor

pedro-w commented Jan 18, 2025

This will probably work.

As an aside, I wonder why we didn't use al_join_thread (in _al_win_shutdown_window) and al_get_thread_should_stop (in resize_event_thread_proc) instead?

@SiegeLord
Copy link
Member

Thanks!

As an aside, I wonder why we didn't use al_join_thread (in _al_win_shutdown_window) and al_get_thread_should_stop (in resize_event_thread_proc) instead?

It's not using Allegro threads, but native Windows threads. I don't know why.

@SiegeLord SiegeLord merged commit 602d462 into liballeg:master Jan 19, 2025
3 checks passed
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.

3 participants