Skip to content

Fix event handlers added to JavaConversionOptions.WarningEncountered not being removed after each converted file - #144

Merged
paulirwin merged 2 commits into
paulirwin:masterfrom
lordmilko:WarningEncountered
Aug 14, 2026
Merged

paulirwin merged 2 commits into
paulirwin:masterfrom
lordmilko:WarningEncountered

Conversation

@lordmilko

@lordmilko lordmilko commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

#146

In JavaToCSharpCli, Program.ConvertToCSharpFile attaches an event handler to the JavaConversionOptions.WarningEncountered event handler. However, this event handler is not removed after the ConvertToCSharpFile method finishes converting the file. As a result, when processing multiple files, every file you process will be added to the existing list of delegates attached to this event handler, resulting in all files processed so far receiving warnings that do not apply to them. This change updates ConvertToCSharpFile to ensure the event handler is unregistered prior to the method's return

@paulirwin paulirwin added the bug label Aug 14, 2026
@paulirwin
paulirwin enabled auto-merge (squash) August 14, 2026 16:32
@paulirwin
paulirwin merged commit f178612 into paulirwin:master Aug 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants