Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: compiled/intrusive_ptr.h

Issue 29385742: Issue 4127 - [emscripten] Convert subscription classes to C++ - Part 2 (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Rebased Created April 13, 2017, 1:01 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiled/filter/Filter.cpp ('k') | compiled/subscription/Subscription.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiled/intrusive_ptr.h
===================================================================
--- a/compiled/intrusive_ptr.h
+++ b/compiled/intrusive_ptr.h
@@ -65,21 +65,21 @@ template<typename T,
class intrusive_ptr
{
public:
explicit intrusive_ptr()
: mPointer(nullptr)
{
}
- explicit intrusive_ptr(T* pointer)
+ explicit intrusive_ptr(T* pointer, bool addRef = true)
: mPointer(pointer)
{
- // Raw pointers always had their reference count increased by whatever gave
- // us the pointer so we don't need to do it here.
+ if (mPointer && addRef)
+ mPointer->AddRef();
}
intrusive_ptr(const intrusive_ptr& other)
: mPointer(other.mPointer)
{
if (mPointer)
mPointer->AddRef();
}
« no previous file with comments | « compiled/filter/Filter.cpp ('k') | compiled/subscription/Subscription.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld