Skip to content

Commit

Permalink
Fix issue
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasbuykx committed Aug 13, 2024
1 parent d894cec commit dfe43b2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/MeshKernelNET/Api/MeshKernelApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ public int CurvilinearGridGetData(int meshKernelId, out DisposableCurvilinearGri
public int CurvilinearGetBoundariesAsPolygons(int meshKernelId, int lowerLeftN, int lowerLeftM, int upperRightN, int upperRightM, out DisposableGeometryList boundaryPolygons)
{
int numberOfPolygonNodes = 0;
boundaryPolygons = new DisposableGeometryList();
int exitCode = MeshKernelDll.CurvilinearCountGetBoundariesAsPolygons(meshKernelId,
lowerLeftN,
lowerLeftM,
Expand All @@ -242,16 +243,15 @@ public int CurvilinearGetBoundariesAsPolygons(int meshKernelId, int lowerLeftN,
ref numberOfPolygonNodes);
if (exitCode != 0)
{
boundaryPolygons = new DisposableGeometryList();
return exitCode;
}

boundaryPolygons = new DisposableGeometryList();
// prepare the data structure for pinning
boundaryPolygons.NumberOfCoordinates = numberOfPolygonNodes;
boundaryPolygons.XCoordinates = new double[numberOfPolygonNodes];
boundaryPolygons.YCoordinates = new double[numberOfPolygonNodes];
double geometrySeparator = GetSeparator();
boundaryPolygons.GeometrySeparator = geometrySeparator;
boundaryPolygons.NumberOfCoordinates = numberOfPolygonNodes;
boundaryPolygons.GeometrySeparator = GetSeparator();
boundaryPolygons.InnerOuterSeparator = GetInnerOuterSeparator();

var geometryListNative = boundaryPolygons.CreateNativeObject();
exitCode = MeshKernelDll.CurvilinearGetBoundariesAsPolygons(meshKernelId,
Expand Down

0 comments on commit dfe43b2

Please sign in to comment.