Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic-graph
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
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
Olivier Stasse
dynamic-graph
Commits
7067b7b6
Commit
7067b7b6
authored
12 years ago
by
Florent Lamiraux
Browse files
Options
Downloads
Patches
Plain Diff
Do not try to delete void*, behavior is undefined.
parent
96fc928e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/dynamic-graph/value.h
+1
-0
1 addition, 0 deletions
include/dynamic-graph/value.h
src/command/value.cpp
+8
-3
8 additions, 3 deletions
src/command/value.cpp
with
9 additions
and
3 deletions
include/dynamic-graph/value.h
+
1
−
0
View file @
7067b7b6
...
@@ -59,6 +59,7 @@ namespace dynamicgraph {
...
@@ -59,6 +59,7 @@ namespace dynamicgraph {
NB_TYPES
NB_TYPES
};
};
~
Value
();
~
Value
();
void
deleteValue
();
explicit
Value
(
const
bool
&
value
);
explicit
Value
(
const
bool
&
value
);
explicit
Value
(
const
unsigned
&
value
);
explicit
Value
(
const
unsigned
&
value
);
explicit
Value
(
const
int
&
value
);
explicit
Value
(
const
int
&
value
);
...
...
This diff is collapsed.
Click to expand it.
src/command/value.cpp
+
8
−
3
View file @
7067b7b6
...
@@ -67,7 +67,7 @@ namespace dynamicgraph {
...
@@ -67,7 +67,7 @@ namespace dynamicgraph {
return
value_
->
matrixValue
();
return
value_
->
matrixValue
();
}
}
Value
::
~
Value
()
void
Value
::
delete
Value
()
{
{
switch
(
type_
)
{
switch
(
type_
)
{
case
BOOL
:
case
BOOL
:
...
@@ -98,6 +98,11 @@ namespace dynamicgraph {
...
@@ -98,6 +98,11 @@ namespace dynamicgraph {
}
}
}
}
Value
::~
Value
()
{
deleteValue
();
}
Value
::
Value
(
const
bool
&
value
)
:
type_
(
BOOL
),
value_
(
new
bool
(
value
))
Value
::
Value
(
const
bool
&
value
)
:
type_
(
BOOL
),
value_
(
new
bool
(
value
))
{
{
}
}
...
@@ -179,9 +184,9 @@ namespace dynamicgraph {
...
@@ -179,9 +184,9 @@ namespace dynamicgraph {
Value
Value
::
operator
=
(
const
Value
&
value
)
Value
Value
::
operator
=
(
const
Value
&
value
)
{
{
if
(
&
value
!=
this
)
{
if
(
&
value
!=
this
)
{
type_
=
value
.
type_
;
if
(
value_
!=
0x0
)
if
(
value_
!=
0x0
)
delete
value_
;
deleteValue
();
type_
=
value
.
type_
;
void
**
ptValue
=
const_cast
<
void
**>
(
&
value_
);
void
**
ptValue
=
const_cast
<
void
**>
(
&
value_
);
*
ptValue
=
copyValue
(
value
);
*
ptValue
=
copyValue
(
value
);
}
}
...
...
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