diff options
author | Andreas Huber <andih@google.com> | 2009-07-16 10:05:57 -0700 |
---|---|---|
committer | Andreas Huber <andih@google.com> | 2009-07-16 10:05:57 -0700 |
commit | f0adf848ffffeca86f4c0210ea237883d9e5e8d5 (patch) | |
tree | 5b6c8e231a6105d5a3ee14e68118d14874fee12b | |
parent | 7151edd5d83b3b770a0dc77cf52f7fe56b2a3af6 (diff) | |
download | frameworks_native-f0adf848ffffeca86f4c0210ea237883d9e5e8d5.zip frameworks_native-f0adf848ffffeca86f4c0210ea237883d9e5e8d5.tar.gz frameworks_native-f0adf848ffffeca86f4c0210ea237883d9e5e8d5.tar.bz2 |
Make MemoryDealer's destructor protected instead of public.
MemoryDealer, like all other subclasses of RefBase,MUST NOT BE stack-allocated, a protected destructor prohibits stack-allocation while allowing the baseclass to properly invoke the subclass' destructor once the refcount drops to 0.
-rw-r--r-- | include/binder/MemoryDealer.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/binder/MemoryDealer.h b/include/binder/MemoryDealer.h index 6628f75..03ac70a 100644 --- a/include/binder/MemoryDealer.h +++ b/include/binder/MemoryDealer.h @@ -218,8 +218,6 @@ public: const sp<HeapInterface>& heap, const sp<AllocatorInterface>& allocator); - virtual ~MemoryDealer(); - virtual sp<IMemory> allocate(size_t size, uint32_t flags = 0); virtual void deallocate(size_t offset); virtual void dump(const char* what, uint32_t flags = 0) const; @@ -228,6 +226,9 @@ public: sp<IMemoryHeap> getMemoryHeap() const { return heap(); } sp<AllocatorInterface> getAllocator() const { return allocator(); } +protected: + virtual ~MemoryDealer(); + private: const sp<HeapInterface>& heap() const; const sp<AllocatorInterface>& allocator() const; |