Skip to content

Improved: Lazy-init TextureHandler in ChannelInfo.get_channel() - #1954

Open
oliv3r wants to merge 1 commit into
retrospect-addon:masterfrom
oliv3r:lazyinit
Open

Improved: Lazy-init TextureHandler in ChannelInfo.get_channel()#1954
oliv3r wants to merge 1 commit into
retrospect-addon:masterfrom
oliv3r:lazyinit

Conversation

@oliv3r

@oliv3r oliv3r commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Channel.init calls TextureHandler.instance().get_texture_uri() immediately, so any caller of get_channel() would crash if TextureHandler had not been explicitly set up beforehand.

Initializing it lazily inside get_channel() means callers no longer need to know about or manage TextureHandler themselves.

@basrieter

Copy link
Copy Markdown
Collaborator

What would be the purpose of this?

@oliv3r
oliv3r force-pushed the lazyinit branch 2 times, most recently from a39d325 to e02c2fe Compare March 28, 2026 13:21
@oliv3r

oliv3r commented Mar 28, 2026

Copy link
Copy Markdown
Contributor Author

I ran into test pipeline crashes because of this. Not 100% it is actually still relevant with some refactoring I did; but i'm getting close to push some clean stuff again; so we can re-evaluate there.

Channel.__init__ calls TextureHandler.instance().get_texture_uri() immediately,
so any caller of get_channel() would crash if TextureHandler had not been
explicitly set up beforehand.

Initializing it lazily inside get_channel() means callers no longer need to
know about or manage TextureHandler themselves.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
@sonarqubecloud

sonarqubecloud Bot commented Apr 4, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment on it to reset.

@github-actions github-actions Bot added the stale Stale issues/PR's label Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Stale issues/PR's

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants