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

Ensure members are initialized before attaching event handlers #2220

Merged
merged 1 commit into from
Jun 8, 2023

Conversation

jnyrup
Copy link
Contributor

@jnyrup jnyrup commented Jun 7, 2023

Inspired by #2218 I found some more places, where we attach event handlers, before initializing instance members used by the event handlers.

Note, I haven't investigated if these scenarios can happen in practice, so this is a better-safe-than-sorry change.

Connection.ctor
    attaching Transport_Closed
        Close(string closeReason)
            using _sessions
            using _callbacks
            using MessageQueue

    initialize _callbacks
    initialize _sessions
    initialize MessageQueue
Worker.ctor
    attaching OnMessageReceived
        OnExecutionContextCreated(RuntimeExecutionContextCreatedResponse e)
            using _executionContextCallback
    initialize _executionContextCallback

@kblok kblok merged commit bfb4597 into hardkoded:master Jun 8, 2023
@jnyrup jnyrup deleted the event_handlers branch June 8, 2023 15:03
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