aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/SetupPGH.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SetupPGH.c b/src/SetupPGH.c
index db4f4ca..cd51f16 100644
--- a/src/SetupPGH.c
+++ b/src/SetupPGH.c
@@ -269,11 +269,11 @@ void PUGH_DestroyPGH (pGH **GHin)
for CCTK_ARRAY groups.
Remember that the connectivity and extras for CCTK_GF types
are shared between all such groups and are destroyed later. */
- if (GA->connectivity != GH->Connectivity[pgroup.dim-1])
+ if (pgroup.dim == 0 || GA->connectivity != GH->Connectivity[pgroup.dim-1])
{
PUGH_DestroyConnectivity (&GA->connectivity);
}
- if (GA->extras != GH->GFExtras[pgroup.dim-1])
+ if (pgroup.dim == 0 || GA->extras != GH->GFExtras[pgroup.dim-1])
{
PUGH_DestroyPGExtras (&GA->extras);
}