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 | 262a583f2da846e8c74d82712957bcdcc88d169a (patch) | |
tree | dca5a2e456e41655a644044fd9500ce1b8ac3b8b /include/binder | |
parent | d0c0e46a4408b22599bc588ea423d9102bcee6bf (diff) | |
download | frameworks_base-262a583f2da846e8c74d82712957bcdcc88d169a.zip frameworks_base-262a583f2da846e8c74d82712957bcdcc88d169a.tar.gz frameworks_base-262a583f2da846e8c74d82712957bcdcc88d169a.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.
Diffstat (limited to 'include/binder')
-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; |