@@ -24,7 +24,7 @@ public static class TileExtractor
2424 /// </summary>
2525 public static void ExtractWithGrid ( ref Model outModel , CityModel cityModel , MeshExtractOptions options , List < Extent > extents )
2626 {
27- using var nativeExtents = NativeVectorExtent . Create ( ) ;
27+ var nativeExtents = NativeVectorExtent . Create ( ) ;
2828 foreach ( var extent in extents )
2929 {
3030 nativeExtents . Add ( extent ) ;
@@ -33,6 +33,7 @@ public static void ExtractWithGrid(ref Model outModel, CityModel cityModel, Mesh
3333 var result = NativeMethods . plateau_tile_extractor_extract_with_grid (
3434 cityModel . Handle , options , nativeExtents . Handle , outModel . Handle
3535 ) ;
36+ nativeExtents . Dispose ( ) ;
3637 DLLUtil . CheckDllError ( result ) ;
3738 }
3839
@@ -45,7 +46,7 @@ public static void ExtractWithGrid(ref Model outModel, CityModel cityModel, Mesh
4546 /// <param name="extents"></param>
4647 public static void ExtractWithCombine ( ref Model outModel , List < CityModel > cityModels , MeshExtractOptions options , List < Extent > extents )
4748 {
48- using var nativeExtents = NativeVectorExtent . Create ( ) ;
49+ var nativeExtents = NativeVectorExtent . Create ( ) ;
4950 foreach ( var extent in extents )
5051 {
5152 nativeExtents . Add ( extent ) ;
@@ -56,6 +57,7 @@ public static void ExtractWithCombine(ref Model outModel, List<CityModel> cityMo
5657 var result = NativeMethods . plateau_tile_extractor_extract_with_combine (
5758 nativePtrs , cityModelCount , options , nativeExtents . Handle , outModel . Handle
5859 ) ;
60+ nativeExtents . Dispose ( ) ;
5961 DLLUtil . CheckDllError ( result ) ;
6062 }
6163
0 commit comments