Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libcdi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpim-sw
libcdi
Commits
77c73b52
Commit
77c73b52
authored
12 years ago
by
Thomas Jahns
Browse files
Options
Downloads
Patches
Plain Diff
Add missing destructor for vlist.
parent
03939f9b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/vlist.c
+31
-21
31 additions, 21 deletions
src/vlist.c
with
31 additions
and
21 deletions
src/vlist.c
+
31
−
21
View file @
77c73b52
...
...
@@ -49,6 +49,9 @@ vlist_compare(vlist_t *a, vlist_t *b)
static
void
vlistPrintKernel
(
vlist_t
*
vlistptr
,
FILE
*
fp
);
static
void
vlist_delete
(
vlist_t
*
vlistptr
);
#ifdef USE_MPI
static
int
vlistGetSizeP
(
void
*
vlistptr
,
MPI_Comm
comm
);
static
void
vlistPackP
(
void
*
vlistptr
,
void
*
buff
,
int
size
,
...
...
@@ -58,7 +61,7 @@ static int vlistTxCode ( void );
resOps
vlist_ops
=
{
(
valCompareFunc
)
vlist_compare
,
fre
e
,
(
valDestroyFunc
)
vlist_delet
e
,
(
valPrintFunc
)
vlistPrintKernel
#ifdef USE_MPI
,
vlistGetSizeP
,
...
...
@@ -186,31 +189,18 @@ int vlistCreate(void)
return
(
vlistID
);
}
/*
@Function vlistDestroy
@Title Destroy a variable list
@Prototype void vlistDestroy(int vlistID)
@Parameter
@Item vlistID Variable list ID, from a previous call to @fref{vlistCreate}
@EndFunction
*/
void
vlistDestroy
(
int
vlistID
)
static
void
vlist_delete
(
vlist_t
*
vlistptr
)
{
vlist_t
*
vlistptr
;
int
nvars
;
int
varID
;
vlistptr
=
vlist_to_pointer
(
vlistID
);
vlist_check_ptr
(
__func__
,
vlistptr
);
int
vlistID
=
vlistptr
->
self
;
vlistDelAtts
(
vlistID
,
CDI_GLOBAL
);
nvars
=
vlistptr
->
nvars
;
int
nvars
=
vlistptr
->
nvars
;
for
(
varID
=
0
;
varID
<
nvars
;
varID
++
)
for
(
int
varID
=
0
;
varID
<
nvars
;
varID
++
)
{
if
(
vlistptr
->
vars
[
varID
].
levinfo
)
free
(
vlistptr
->
vars
[
varID
].
levinfo
);
if
(
vlistptr
->
vars
[
varID
].
name
)
free
(
vlistptr
->
vars
[
varID
].
name
);
...
...
@@ -222,12 +212,32 @@ void vlistDestroy(int vlistID)
if
(
vlistptr
->
vars
[
varID
].
deco
)
free
(
vlistptr
->
vars
[
varID
].
deco
);
vlistDelAtts
(
vlistID
,
varID
);
}
if
(
vlistptr
->
vars
)
free
(
vlistptr
->
vars
);
vlist_delete_entry
(
vlistptr
);
}
/*
@Function vlistDestroy
@Title Destroy a variable list
@Prototype void vlistDestroy(int vlistID)
@Parameter
@Item vlistID Variable list ID, from a previous call to @fref{vlistCreate}
@EndFunction
*/
void
vlistDestroy
(
int
vlistID
)
{
vlist_t
*
vlistptr
;
vlistptr
=
vlist_to_pointer
(
vlistID
);
vlist_delete
(
vlistptr
);
}
/*
@Function vlistCopy
@Title Copy a variable list
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment