From 37d4f87ed3a8b4e0c68042709dee37811dc9ba17 Mon Sep 17 00:00:00 2001 From: Ehsan Akhgari Date: Tue, 23 Dec 2014 17:27:11 -0500 Subject: [PATCH] Bug 1114989 - Convert Shmem::mSegment to nsRefPtr; r=jrmuizel --HG-- extra : rebase_source : 9045464e9bdf365993999a5db83e68b21f4f44d6 --- ipc/glue/Shmem.cpp | 2 +- ipc/glue/Shmem.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ipc/glue/Shmem.cpp b/ipc/glue/Shmem.cpp index 09731e366c44..c61df34b335a 100644 --- a/ipc/glue/Shmem.cpp +++ b/ipc/glue/Shmem.cpp @@ -624,7 +624,7 @@ Shmem::ShareTo(IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead, } if (SharedMemory::TYPE_BASIC == mSegment->Type()) { - SharedMemoryBasic* seg = static_cast(mSegment); + SharedMemoryBasic* seg = static_cast(mSegment.get()); SharedMemoryBasic::Handle handle; if (!seg->ShareToProcess(aProcess, &handle)) return nullptr; diff --git a/ipc/glue/Shmem.h b/ipc/glue/Shmem.h index 415c4ef33c97..874629634e7e 100644 --- a/ipc/glue/Shmem.h +++ b/ipc/glue/Shmem.h @@ -77,7 +77,7 @@ public: struct IHadBetterBeIPDLCodeCallingThis_OtherwiseIAmADoodyhead {}; Shmem() : - mSegment(nullptr), + mSegment(), mData(nullptr), mSize(0), mId(0) @@ -265,7 +265,7 @@ private: void AssertInvariants() const; #endif - SharedMemory* mSegment; + nsRefPtr mSegment; void* mData; size_t mSize; id_t mId;