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

Fix on TemporaryDirectory type. #1141

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/pages/_en/1.0/reference/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ group: Deployment & Configs

{% include ltr/release_header_next.html title="Upcoming Changes" note=rc_release_notes %}

{% include ltr/release-header.html title="v1.22 RC4" version="v1.22.8951.18278" pre_release=true time="07/04/2024" %}

- Misc Improvements

{% include ltr/release-header.html title="v1.22 RC3" version="v1.22.8913.17329" pre_release=true time="06/02/2024" %}

- Fixed a bug with Revit transactions
Expand Down
9 changes: 7 additions & 2 deletions src/RhinoInside.Revit.External/TemporaryDirectory.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using System;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading;

namespace RhinoInside.Revit
{
Expand All @@ -12,8 +14,11 @@ internal class TemporaryDirectory
{
class TemporaryPrefixGenerator : ITemporaryPrefixGenerator
{
readonly System.Runtime.Serialization.ObjectIDGenerator Generator = new System.Runtime.Serialization.ObjectIDGenerator();
public string PrefixOf(object value) => Generator.GetId(value, out var _).ToString("X16");
private readonly ConditionalWeakTable<object, string> Prefixes = new ConditionalWeakTable<object, string>();
private long Seed;

public string PrefixOf(object value) => value is null ? null :
Prefixes.GetValue(value, (k) => Interlocked.Increment(ref Seed).ToString("X16"));
}

public readonly DirectoryInfo Directory;
Expand Down
Loading