diff options
author | Piotr Dziwinski <piotrdz@gmail.com> | 2012-12-28 13:37:08 +0100 |
---|---|---|
committer | Piotr Dziwinski <piotrdz@gmail.com> | 2012-12-28 13:37:08 +0100 |
commit | 3e4c1a1ad88456ebf201b257b91847bd995c8773 (patch) | |
tree | 0e2b83aaa3117ee93a6d96140cc146a9587be41c /src/object/task/taskgoto.cpp | |
parent | 4cbb63f5b7824dc48e999401c625adb50075fdca (diff) | |
download | colobot-3e4c1a1ad88456ebf201b257b91847bd995c8773.tar.gz colobot-3e4c1a1ad88456ebf201b257b91847bd995c8773.tar.bz2 colobot-3e4c1a1ad88456ebf201b257b91847bd995c8773.zip |
Replaced malloc/free with new/delete
- now new/delete used everywhere except for CBotStack, which
has to be fixed in other way
- some segfaults should be fixed with this
Diffstat (limited to 'src/object/task/taskgoto.cpp')
-rw-r--r-- | src/object/task/taskgoto.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/object/task/taskgoto.cpp b/src/object/task/taskgoto.cpp index ce778ef..cab57f1 100644 --- a/src/object/task/taskgoto.cpp +++ b/src/object/task/taskgoto.cpp @@ -2119,7 +2119,7 @@ bool CTaskGoto::BitmapOpen() BitmapClose(); m_bmSize = static_cast<int>(3200.0f/BM_DIM_STEP); - m_bmArray = static_cast<unsigned char*>(malloc(m_bmSize*m_bmSize/8*2)); + m_bmArray = new unsigned char[m_bmSize*m_bmSize/8*2]; memset(m_bmArray, 0, m_bmSize*m_bmSize/8*2); m_bmOffset = m_bmSize/2; @@ -2137,7 +2137,7 @@ bool CTaskGoto::BitmapOpen() bool CTaskGoto::BitmapClose() { - free(m_bmArray); + delete[] m_bmArray; m_bmArray = 0; return true; } |