Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hurstel
CGoGN
Commits
cbaa11ce
Commit
cbaa11ce
authored
Aug 14, 2012
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correctly delete registry at map destruction (thanks to valgrind)
parent
c4277eaa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
include/Topology/generic/genericmap.h
include/Topology/generic/genericmap.h
+2
-0
src/Topology/generic/genericmap.cpp
src/Topology/generic/genericmap.cpp
+15
-1
No files found.
include/Topology/generic/genericmap.h
View file @
cbaa11ce
...
...
@@ -83,6 +83,8 @@ protected:
static
std
::
map
<
std
::
string
,
RegisteredBaseAttribute
*>*
m_attributes_registry_map
;
static
int
m_nbInstances
;
/**
* Direct access to the Dart attributes that store the orbits embeddings
* (only initialized when necessary)
...
...
src/Topology/generic/genericmap.cpp
View file @
cbaa11ce
...
...
@@ -34,12 +34,15 @@ namespace CGoGN
{
std
::
map
<
std
::
string
,
RegisteredBaseAttribute
*>*
GenericMap
::
m_attributes_registry_map
=
NULL
;
int
GenericMap
::
m_nbInstances
=
0
;
GenericMap
::
GenericMap
()
:
m_nbThreads
(
1
)
{
if
(
m_attributes_registry_map
==
NULL
)
m_attributes_registry_map
=
new
std
::
map
<
std
::
string
,
RegisteredBaseAttribute
*>
;
m_nbInstances
++
;
// register all known types
registerAttribute
<
Dart
>
(
"Dart"
);
registerAttribute
<
Mark
>
(
"Mark"
);
...
...
@@ -115,8 +118,19 @@ GenericMap::~GenericMap()
(
*
it
)
->
setReleaseOnDestruct
(
false
)
;
cellMarkers
.
clear
()
;
if
(
m_attributes_registry_map
)
// if(m_attributes_registry_map)
// {
// delete m_attributes_registry_map;
// m_attributes_registry_map = NULL;
// }
// clean type registry if necessary
m_nbInstances
--
;
if
(
m_nbInstances
<=
0
)
{
for
(
std
::
map
<
std
::
string
,
RegisteredBaseAttribute
*>::
iterator
it
=
m_attributes_registry_map
->
begin
();
it
!=
m_attributes_registry_map
->
end
();
++
it
)
delete
it
->
second
;
delete
m_attributes_registry_map
;
m_attributes_registry_map
=
NULL
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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