refactor(core): унификация COM-хелперов и классификаторов топологии
Вынесены общие ComHelper (Release + Safe-геттеры) и GeomClassifiers (FaceType/EdgeType), устранены дубли в 5+ сервисах. Освобождение doc3d RCW в GetTopPart, void-возвраты вместо фиктивных bool, HashSet для OpKinds, DocumentTypeName в паспорте модели, FileExtension без аллокаций. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Versioning;
|
||||
using Kompas.Mcp.Core.Interop;
|
||||
using Kompas.Mcp.Core.Threading;
|
||||
using Kompas6API5;
|
||||
using Kompas6Constants3D;
|
||||
@@ -432,14 +432,7 @@ public sealed class PartModeler : IDisposable
|
||||
_nextId = 1;
|
||||
}
|
||||
|
||||
private static void ReleaseCom(object? comObject)
|
||||
{
|
||||
if (comObject is not null && Marshal.IsComObject(comObject))
|
||||
{
|
||||
try { Marshal.ReleaseComObject(comObject); }
|
||||
catch { /* освобождение не критично */ }
|
||||
}
|
||||
}
|
||||
private static void ReleaseCom(object? comObject) => ComHelper.Release(comObject);
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user