Skip to content

Add listener dispose handlers#986

Merged
masesdevelopers merged 5 commits intomasterfrom
964-verify-how-to-apply-a-dispose-pattern-in-callbacks-returning-disposable-objects
Apr 25, 2026
Merged

Add listener dispose handlers#986
masesdevelopers merged 5 commits intomasterfrom
964-verify-how-to-apply-a-dispose-pattern-in-callbacks-returning-disposable-objects

Conversation

@masesdevelopers
Copy link
Copy Markdown
Contributor

@masesdevelopers masesdevelopers commented Apr 25, 2026

Description

Introduce support for listener dispose handlers and disable the ReturnData setter. Added a LISTENER_DISPOSE_HANDLER placeholder and LISTENER_DISPOSE_HANDLER_FORMAT to Templates, updated SingleListenerMethod.template to emit the dispose placeholder, and updated InternalMethods to inject the dispose handler only for non-void return types. Also append a call to the dispose callback after func listener execution. Disabled the ReturnData setter in JNetEventResult because the JVM raises an exception when setting it.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Introduce support for listener dispose handlers and disable the ReturnData setter. Added a LISTENER_DISPOSE_HANDLER placeholder and LISTENER_DISPOSE_HANDLER_FORMAT to Templates, updated SingleListenerMethod.template to emit the dispose placeholder, and updated InternalMethods to inject the dispose handler only for non-void return types. Also append a call to the dispose callback after func listener execution. Disabled the ReturnData setter in JNetEventResult because the JVM raises an exception when setting it.
@masesdevelopers masesdevelopers merged commit d2b96c4 into master Apr 25, 2026
25 checks passed
@masesdevelopers masesdevelopers deleted the 964-verify-how-to-apply-a-dispose-pattern-in-callbacks-returning-disposable-objects branch April 25, 2026 02:54
@masesdevelopers masesdevelopers added enhancement New feature or request JNetReflector JNetReflector related issue .NET Pull requests that update .net code java Pull requests that update Java code labels Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request java Pull requests that update Java code JNetReflector JNetReflector related issue .NET Pull requests that update .net code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Verify how to apply a Dispose pattern in callbacks returning Disposable objects

1 participant