Skip to content

Commit

Permalink
Add constructor failing dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcb committed Aug 5, 2023
1 parent 4e23058 commit 2550c1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/00-common.linq
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static ProjectVersion[] Projects = new[]
new ProjectVersion("Sdcb.Mkldnn", "0.19"), // 0.19
new ProjectVersion("Sdcb.Paddle2Onnx", "1.0.0-rc.2"), // 1.0.0-rc.2
new ProjectVersion("Sdcb.PaddleInference", "2.5.0.1"),
new ProjectVersion("Sdcb.PaddleOCR", "2.6.0.6-preview.7"),
new ProjectVersion("Sdcb.PaddleOCR", "2.6.0.6-preview.8"),
new ProjectVersion("Sdcb.PaddleOCR.Models.Online", "2.6.0.6-preview.6"),
new ProjectVersion("Sdcb.PaddleOCR.Models.LocalV3", "2.6.0.6-preview.6"),
new ProjectVersion("Sdcb.PaddleDetection", "2.3.3"),
Expand Down
10 changes: 9 additions & 1 deletion src/Sdcb.PaddleOCR/QueuedPaddleOcrAll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,17 @@ public QueuedPaddleOcrAll(Func<PaddleOcrAll> factory, int consumerCount = 1, int
_workers[i] = Task.Run(ProcessQueue);
}

try
{
#pragma warning disable CS0618 // Method exposed for compatibility to the outside, now it called in constructor, will change to private in a future version.
WaitFactoryReady();
WaitFactoryReady();
#pragma warning restore CS0618 // Method exposed for compatibility to the outside, now it called in constructor, will change to private in a future version.
}
catch (AggregateException)
{
Dispose();
throw;
}
}

/// <summary>
Expand Down

0 comments on commit 2550c1c

Please sign in to comment.