Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
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
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Timo Koch
dune-common
Commits
2cde0e98
Commit
2cde0e98
authored
13 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
check whether assignment from a null pointer properly deallocates memory
[[Imported from SVN: r6470]]
parent
24a898c3
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
dune/common/test/shared_ptrtest.cc
+9
-0
9 additions, 0 deletions
dune/common/test/shared_ptrtest.cc
with
9 additions
and
0 deletions
dune/common/test/shared_ptrtest.cc
+
9
−
0
View file @
2cde0e98
...
...
@@ -184,6 +184,15 @@ int main(){
ret
=
1
;
}
// test assignment from null ptr
// (should trigger FS 936, needs valgrind to check)
{
shared_ptr
<
int
>
foo
=
shared_ptr
<
int
>
(
new
int
(
42
));
shared_ptr
<
int
>
bar
;
//null ptr
foo
=
bar
;
// should release memory held by foo
}
// test shared_ptr for stack allocation
{
int
i
=
10
;
...
...
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