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
98552767
Commit
98552767
authored
14 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
Fix copy construction and assignment from a null pointer.
This fixes FS 864. [[Imported from SVN: r6322]]
parent
3afb9c91
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/shared_ptr.hh
+6
-3
6 additions, 3 deletions
dune/common/shared_ptr.hh
with
6 additions
and
3 deletions
dune/common/shared_ptr.hh
+
6
−
3
View file @
98552767
...
...
@@ -214,14 +214,17 @@ namespace Dune
template
<
class
T
>
inline
shared_ptr
<
T
>::
shared_ptr
(
const
shared_ptr
<
T
>&
other
)
:
rep_
(
other
.
rep_
)
{
++
(
rep_
->
count_
);
if
(
rep_
)
++
(
rep_
->
count_
);
}
template
<
class
T
>
inline
shared_ptr
<
T
>&
shared_ptr
<
T
>::
operator
=
(
const
shared_ptr
<
T
>&
other
)
{
(
other
.
rep_
->
count_
)
++
;
if
(
rep_
!=
0
&&
--
(
rep_
->
count_
)
<=
0
)
delete
rep_
;
if
(
other
.
rep_
)
{
(
other
.
rep_
->
count_
)
++
;
if
(
rep_
!=
0
&&
--
(
rep_
->
count_
)
<=
0
)
delete
rep_
;
}
rep_
=
other
.
rep_
;
return
*
this
;
}
...
...
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