diff options
author | Paul Gilbert | 2012-05-04 23:20:01 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-05-04 23:20:01 +1000 |
commit | e628da0cccbba04c9d19b28b46e97107ab66beb7 (patch) | |
tree | 42ae6c397acde303c88c303d2436e1d0835632e7 | |
parent | 3184a5a874f3cfaa75424e7efb21f1cca3702988 (diff) | |
download | scummvm-rg350-e628da0cccbba04c9d19b28b46e97107ab66beb7.tar.gz scummvm-rg350-e628da0cccbba04c9d19b28b46e97107ab66beb7.tar.bz2 scummvm-rg350-e628da0cccbba04c9d19b28b46e97107ab66beb7.zip |
TONY: Fix some inconsistent allocation/deallocations
-rw-r--r-- | engines/tony/mpal/memory.cpp | 6 | ||||
-rw-r--r-- | engines/tony/mpal/memory.h | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/engines/tony/mpal/memory.cpp b/engines/tony/mpal/memory.cpp index 604e61ed24..de6e918a38 100644 --- a/engines/tony/mpal/memory.cpp +++ b/engines/tony/mpal/memory.cpp @@ -127,9 +127,9 @@ uint32 MemoryManager::getSize(HGLOBAL handle) { /** * Erases a given item */ -void MemoryManager::erase(MemoryItem &item) { +void MemoryManager::erase(MemoryItem *item) { delete item; - _memoryBlocks.remove(&item); + _memoryBlocks.remove(item); } /** @@ -137,7 +137,7 @@ void MemoryManager::erase(MemoryItem &item) { */ void MemoryManager::erase(HGLOBAL handle) { MemoryItem &item = getItem(handle); - erase(item); + erase(&item); } } // end of namespace MPAL diff --git a/engines/tony/mpal/memory.h b/engines/tony/mpal/memory.h index fde0d33b3e..ebf42b6207 100644 --- a/engines/tony/mpal/memory.h +++ b/engines/tony/mpal/memory.h @@ -36,14 +36,14 @@ typedef HANDLE HGLOBAL; class MemoryItem { protected: - void *_buffer; + byte *_buffer; uint32 _size; public: MemoryItem(uint32 size); virtual ~MemoryItem(); uint32 Size() { return _size; } - void *DataPointer() { return _buffer; } + void *DataPointer() { return (void *)_buffer; } bool IsValid() { return _buffer != NULL; } // Casting for access to data @@ -61,7 +61,7 @@ public: HGLOBAL alloc(uint32 size); MemoryItem &getItem(HGLOBAL handle); MemoryItem &operator[](HGLOBAL handle); - void erase(MemoryItem &item); + void erase(MemoryItem *item); void erase(HGLOBAL handle); uint32 getSize(HANDLE handle); |