Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
11c4d482
Commit
11c4d482
authored
9 years ago
by
Michel Rasquin
Browse files
Options
Downloads
Patches
Plain Diff
Fix for clean memory deallocation
parent
50c81fbe
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Common/Gmsh.cpp
+10
-1
10 additions, 1 deletion
Common/Gmsh.cpp
Post/PViewData.cpp
+11
-0
11 additions, 0 deletions
Post/PViewData.cpp
Post/PViewData.h
+1
-0
1 addition, 0 deletions
Post/PViewData.h
with
22 additions
and
1 deletion
Common/Gmsh.cpp
+
10
−
1
View file @
11c4d482
...
...
@@ -23,6 +23,7 @@
#include
"robustPredicates.h"
#if defined(HAVE_POST)
#include
"PView.h"
#include
"PViewData.h"
#endif
#if defined(HAVE_ONELAB) && !defined(HAVE_ONELAB2)
...
...
@@ -230,10 +231,18 @@ int GmshWriteFile(const std::string &fileName)
int
GmshFinalize
()
{
#if defined(HAVE_POST)
// Delete all PViewData stored in static PView list
for
(
unsigned
int
i
=
0
;
i
<
PView
::
list
.
size
();
i
++
)
{
delete
PView
::
list
[
i
];
}
PView
::
list
.
clear
();
// Delete static interpolationSchemes
PViewData
::
removeAllInterpolationSchemes
();
#endif
// Delete all Gmodels
for
(
unsigned
int
i
=
0
;
i
<
GModel
::
list
.
size
();
i
++
)
delete
GModel
::
list
[
i
];
GModel
::
list
.
clear
();
CTX
::
instance
()
->
files
.
clear
();
return
1
;
}
...
...
This diff is collapsed.
Click to expand it.
Post/PViewData.cpp
+
11
−
0
View file @
11c4d482
...
...
@@ -196,6 +196,17 @@ void PViewData::removeInterpolationScheme(const std::string &name)
}
}
void
PViewData
::
removeAllInterpolationSchemes
()
{
std
::
map
<
std
::
string
,
interpolationMatrices
>::
iterator
it
=
_interpolationSchemes
.
begin
();
for
(;
it
!=
_interpolationSchemes
.
end
();
it
++
)
for
(
interpolationMatrices
::
iterator
it2
=
it
->
second
.
begin
();
it2
!=
it
->
second
.
end
();
it2
++
)
for
(
unsigned
int
i
=
0
;
i
<
it2
->
second
.
size
();
i
++
)
delete
it2
->
second
[
i
];
_interpolationSchemes
.
clear
();
}
void
PViewData
::
addMatrixToInterpolationScheme
(
const
std
::
string
&
name
,
int
type
,
fullMatrix
<
double
>
&
mat
)
{
...
...
This diff is collapsed.
Click to expand it.
Post/PViewData.h
+
1
−
0
View file @
11c4d482
...
...
@@ -228,6 +228,7 @@ class PViewData {
// access to global interpolation schemes
static
void
removeInterpolationScheme
(
const
std
::
string
&
name
);
static
void
removeAllInterpolationSchemes
();
static
void
addMatrixToInterpolationScheme
(
const
std
::
string
&
name
,
int
type
,
fullMatrix
<
double
>
&
mat
);
static
int
getSizeInterpolationScheme
()
{
return
_interpolationSchemes
.
size
();}
...
...
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