Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
43f2db77
Commit
43f2db77
authored
Mar 14, 2017
by
Joshua Haberman
Committed by
GitHub
Mar 14, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2843 from haberman/check
Replace CHECK() with GOOGLE_CHECK().
parents
f0a5c103
874e382f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
shared_ptr.h
src/google/protobuf/stubs/shared_ptr.h
+4
-3
No files found.
src/google/protobuf/stubs/shared_ptr.h
View file @
43f2db77
...
...
@@ -428,11 +428,11 @@ class enable_shared_from_this {
shared_ptr
<
T
>
shared_from_this
()
{
// Behavior is undefined if the precondition isn't satisfied; we choose
// to die with a CHECK failure.
CHECK
(
!
weak_this_
.
expired
())
<<
"No shared_ptr owns this object"
;
GOOGLE_
CHECK
(
!
weak_this_
.
expired
())
<<
"No shared_ptr owns this object"
;
return
weak_this_
.
lock
();
}
shared_ptr
<
const
T
>
shared_from_this
()
const
{
CHECK
(
!
weak_this_
.
expired
())
<<
"No shared_ptr owns this object"
;
GOOGLE_
CHECK
(
!
weak_this_
.
expired
())
<<
"No shared_ptr owns this object"
;
return
weak_this_
.
lock
();
}
...
...
@@ -456,7 +456,8 @@ class enable_shared_from_this {
template
<
typename
T
>
void
shared_ptr
<
T
>::
MaybeSetupWeakThis
(
enable_shared_from_this
<
T
>*
ptr
)
{
if
(
ptr
)
{
CHECK
(
ptr
->
weak_this_
.
expired
())
<<
"Object already owned by a shared_ptr"
;
GOOGLE_CHECK
(
ptr
->
weak_this_
.
expired
())
<<
"Object already owned by a shared_ptr"
;
ptr
->
weak_this_
=
*
this
;
}
}
...
...
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