Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zhang Xin
star_SED
Commits
4ff29429
Commit
4ff29429
authored
Nov 29, 2024
by
Zhang Xin
Browse files
add free mem
parent
80cc614c
Changes
1
Hide whitespace changes
Inline
Side-by-side
main_singlestar.c
View file @
4ff29429
...
...
@@ -70,6 +70,7 @@ void printerror(int);
int
loadSpecLibs
(
char
*
,
char
*
);
void
loadExts
(
char
*
);
void
interpSingleStar
(
struct
STAR
,
float
*
,
float
*
);
void
freeGlobeData
();
int
NZ
=
0
,
NWV
=
0
;
struct
SPECLIB
*
speclibs
=
NULL
;
...
...
@@ -189,6 +190,7 @@ int loadSpecLibs(char *file_par, char *specDir)
//for (icol=icol_start; icol<speclibs[iZ].nspec+2; icol++)
//for (icol=icol_start; icol<naxes[0]/4+1; icol++)
for
(
icol
=
icol_start
;
icol
<
naxes
[
0
]
/
Nbyte
+
1
;
icol
++
)
{
//if (ispec==speclibs[iZ].nspec) break;
...
...
@@ -345,4 +347,32 @@ void interpSingleStar(struct STAR star, float *outspec, float *outspecWave)
}
void
freeGlobeData
(){
if
(
speclibs
!=
NULL
){
int
i
;
for
(
i
=
0
;
i
<
NZ
;
i
++
){
free
(
speclibs
[
i
].
logts
);
free
(
speclibs
[
i
].
UniqueLogts
);
free
(
speclibs
[
i
].
iLogts
);
free
(
speclibs
[
i
].
loggs
);
free
(
speclibs
[
i
].
UniqueLoggs
);
free
(
speclibs
[
i
].
iLoggs
);
free
(
speclibs
[
i
].
wvs
);
int
j
=
0
;
for
(
j
=
0
;
j
<
speclibs
[
i
].
nspec
;
j
++
){
free
(
speclibs
[
i
].
specs
[
j
]);
speclibs
[
i
].
specs
[
j
]
=
NULL
;
}
free
(
speclibs
[
i
].
specs
);
}
free
(
speclibs
);
speclibs
=
NULL
;
}
if
(
Exts
!=
NULL
){
free
(
Exts
);
Exts
=
NULL
;
}
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment