Skip to content

response.Dispose() doesn't stop listening to event for OnAsync() #156

@SergueiRazykov

Description

@SergueiRazykov

We call Dispose() method when trying to re-connect but it doesn't stop the listening to events

        try
        {
            if (_fbOnAsyncResponse != null)
            {
                _fbOnAsyncResponse.Dispose();
            }
        }
        catch (Exception ex)
        {
            this.Log().Warn($"Failed to dispose {ex.Message}");
            //no-op//
        }

        _fbOnAsyncResponse = await _firebaseClient.OnAsync(path,
            added: async (s, args, d) =>
            {

......

After it is called a few times, the event is processed by a few threads the same time.
Version FireSharp 2.0.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions