Skip to content

Tag destructor throws an exception with an incorrect IP #432

@VitorKawao

Description

@VitorKawao

Hello,

I am using libplctag at version 1.6.0-alpha.2 and libplctag.NativeImport at version 2.0.0.0-alpha.5

I am trying to connect to Compact Logix PLC (Allen Bradley).
It works fine when the IP is correct, but when I use an invalid IP or the network is down, it generates an exception in the Tag destructor. (ErrNullPtr)

Image

When I call tag.Initialize(); with an incorrect IP, it throws an exception that I can handle. However, after some time, the destructor is called asynchronously, and it throws the same exception again, causing my app to crash.

Is there a better way to check for a connection than using tag.Initialize()? Or is it possible to handle this exception?

I am attaching my debug logs

log.txt

Thank you,
Vítor Guedes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions