Skip to content

GlobalResourceDownloadManager - #1300

Merged
jw098 merged 2 commits into
PokemonAutomation:mainfrom
jw098:download-manager
Jun 24, 2026
Merged

GlobalResourceDownloadManager#1300
jw098 merged 2 commits into
PokemonAutomation:mainfrom
jw098:download-manager

Conversation

@jw098

@jw098 jw098 commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@jw098

jw098 commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator Author

Note: RequiredDownload was renamed to ResourceDownload

ConditionVariable& m_cv;
DownloadThread m_download_thread;

ListenerSet<Listener> m_listeners;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During destruction of this class, m_listeners will be destructed before m_download_thread since destruction is in reverse order.

When m_listeners is destructed, the thread is still running and may try to call into it if a download finishes/fails at the same time.

So you should add a destructor for this class and have it explicitly end the thread as the very first thing. I suspect this might be partly responsible for issue you're having earlier where you need to delay destruction of the downloads to after the lock. (though I suspect there's a complicated deadlock going on with all these listeners)

@jw098
jw098 merged commit eb98eb2 into PokemonAutomation:main Jun 24, 2026
7 checks passed
@jw098
jw098 deleted the download-manager branch June 24, 2026 23:48
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