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

reference leaks - server disconnected on startup #26

Open
gabpasro opened this issue Jul 31, 2024 · 0 comments
Open

reference leaks - server disconnected on startup #26

gabpasro opened this issue Jul 31, 2024 · 0 comments

Comments

@gabpasro
Copy link

gabpasro commented Jul 31, 2024

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

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

No branches or pull requests

1 participant