Skip to content

Commit

Permalink
We have to retrieve the Status because plc_tag_create_ex returns ei…
Browse files Browse the repository at this point in the history
…ther an error (<0) or a handle according to the core library documentation.
  • Loading branch information
timyhac committed Oct 8, 2024
1 parent 374d05a commit 271df45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libplctag/Tag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -718,12 +718,12 @@ public async Task InitializeAsync(CancellationToken token = default)
}

// Await while Pending
if(result == (int)Status.Pending)
if(GetStatus() == Status.Pending)
{
await createTask.Task.ConfigureAwait(false);
}

// Tear down and throw on error
// On error, tear down and throw
if(createTask.Task.Result != Status.Ok)
{
RemoveEventsAndRemoveCallback();
Expand Down

0 comments on commit 271df45

Please sign in to comment.