Skip to content

reference leaks - server disconnected on startup #26

Open
@gabpasro

Description

@gabpasro

Table of Contents

Evidence:

Hello, I have detected that at the beginning, if the mqtt broker is not open, the references are not managed correctly:

  • Reference leaks
    imagen
  • Architecture used
    imagen

Problem:

Connect to Server

imagen
Path: <vi.lib>\LabVIEW Open Source Project\MQTT Client\Client class\Connect to Server.vi

  1. First, the connection class references are created, and then the TCP connection is opened. At this point, if the connection is failed, an error will be returned.
    Path: <vi.lib>\LabVIEW Open Source Project\Connection\Connection\CreateReferences.vi
    imagen

  2. Next, the connection object is inserted into the session class, at this point in case of error it is not being registered, so the open references of the vi from point 1 are lost)
    Path: <vi.lib>\LabVIEW Open Source Project\MQTT Connection\MQTT_Base\Session\Create Session.vi
    imagen

Stop

imagen
Path: <vi.lib>\LabVIEW Open Source Project\MQTT Connection\MQTT_Base\Base Class\Stop.vi

  1. Since the closing of references of the connection object is done from the session class, and in case of error in point 2 it has not been opened or registered, the references remain open.
    Path: <vi.lib>\LabVIEW Open Source Project\MQTT Client\Client class\onStop.vi
    imagen

Proposed Solution:

  1. Manage the opening of references in case the connection does not return an error.
    Path: <vi.lib>\LabVIEW Open Source Project\Connection\Connection\CreateReferences.vi
    imagen

  2. Close the reference in case of error creating the session.
    Path: <vi.lib>\LabVIEW Open Source Project\MQTT Connection\MQTT_Base\Session\Create Session.vi
    imagen

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions