View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002338 | NoesisGUI | C# SDK | public | 2022-04-28 15:18 | 2022-05-30 18:19 |
| Reporter | AndreN | Assigned To | sfernandez | ||
| Priority | normal | Severity | minor | ||
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.1.4 | ||||
| Target Version | 3.1.5 | Fixed in Version | 3.1.5 | ||
| Summary | 0002338: LocalFontProvider is not closing Stream and thus running into errors | ||||
| Description | Hello When working with the LocalFontProvider from the NoesisApp namespace, I noticed an issue.
public override Stream OpenFont(Uri folder, string id) => (Stream) new FileStream(System.IO.Path.Combine(this._basePath, folder.GetPath(), id), FileMode.Open);
Unhandled exception. System.IO.IOException: The process cannot access the file '<path-to-gui-files>\Fonts\Aero Matics Regular.ttf' because it is being used by another process.
public override Stream OpenFont(Uri folder, string id) => (Stream) File.OpenRead(System.IO.Path.Combine(this.rootPath, folder.GetPath(), id));
new FileStream(<path>, FileMode.Open, FileAccess.Read, FileShare.Read);
Nevertheless, there is still the question: Is it intended, that the file-stream is not being closed after the first read (scan of the directory)? If so, why is the stream not reused internally instead of reading the same file again? So I'm not completely sure, if "just settings the file share to read mode" is really a fix or a workaround? What do you think about this? P.S.: I don't know how to do (inline) code formating in this ticket description. | ||||
| Platform | Windows | ||||
|
Thanks for the information, we opted to use OpenRead in the providers. And also fixed the implementation of RegisterFont to close the stream after it is read. |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2022-04-28 15:18 | AndreN | New Issue | |
| 2022-04-28 15:21 | AndreN | Description Updated | |
| 2022-04-28 15:59 | sfernandez | Assigned To | => sfernandez |
| 2022-04-28 15:59 | sfernandez | Status | new => assigned |
| 2022-04-28 15:59 | sfernandez | Target Version | => 3.1.5 |
| 2022-05-30 18:19 | sfernandez | Status | assigned => resolved |
| 2022-05-30 18:19 | sfernandez | Resolution | open => fixed |
| 2022-05-30 18:19 | sfernandez | Fixed in Version | => 3.1.5 |
| 2022-05-30 18:19 | sfernandez | Note Added: 0007947 |