diff options
author | Einar Johan Trøan Sømåen | 2012-03-12 20:56:26 +0100 |
---|---|---|
committer | Einar Johan Trøan Sømåen | 2012-06-02 12:12:34 +0200 |
commit | f33e2d1824738ebe76d26a89498627ca13814e7f (patch) | |
tree | 46a57c8ed75b8cbf84fb9f297b7dbc48778e916b | |
parent | 4b2b236abd6b30c977b1a2858cc1b90eaf85cb10 (diff) | |
download | scummvm-rg350-f33e2d1824738ebe76d26a89498627ca13814e7f.tar.gz scummvm-rg350-f33e2d1824738ebe76d26a89498627ca13814e7f.tar.bz2 scummvm-rg350-f33e2d1824738ebe76d26a89498627ca13814e7f.zip |
WINTERMUTE: Silence a few SAFE_DELETE-related warnings.
-rw-r--r-- | engines/wintermute/BFontBitmap.cpp | 8 | ||||
-rw-r--r-- | engines/wintermute/BNamedObject.cpp | 5 | ||||
-rw-r--r-- | engines/wintermute/UITiledImage.cpp | 8 | ||||
-rw-r--r-- | engines/wintermute/UIWindow.cpp | 37 |
4 files changed, 36 insertions, 22 deletions
diff --git a/engines/wintermute/BFontBitmap.cpp b/engines/wintermute/BFontBitmap.cpp index e7a1466ed0..4b5b0c6199 100644 --- a/engines/wintermute/BFontBitmap.cpp +++ b/engines/wintermute/BFontBitmap.cpp @@ -62,8 +62,10 @@ CBFontBitmap::CBFontBitmap(CBGame *inGame): CBFont(inGame) { //////////////////////////////////////////////////////////////////////
CBFontBitmap::~CBFontBitmap() {
- SAFE_DELETE(m_Subframe);
- SAFE_DELETE(m_Sprite);
+ delete m_Subframe;
+ delete m_Sprite;
+ m_Subframe = NULL;
+ m_Sprite = NULL;
}
@@ -395,7 +397,7 @@ HRESULT CBFontBitmap::LoadBuffer(byte *Buffer) { }
if (sprite_file != NULL) {
- SAFE_DELETE(m_Sprite);
+ delete m_Sprite;
m_Sprite = new CBSprite(Game, this);
if (!m_Sprite || FAILED(m_Sprite->LoadFile(sprite_file))) SAFE_DELETE(m_Sprite);
}
diff --git a/engines/wintermute/BNamedObject.cpp b/engines/wintermute/BNamedObject.cpp index 0f2df63aea..161f479b81 100644 --- a/engines/wintermute/BNamedObject.cpp +++ b/engines/wintermute/BNamedObject.cpp @@ -49,13 +49,14 @@ CBNamedObject::CBNamedObject(TDynamicConstructor, TDynamicConstructor) { //////////////////////////////////////////////////////////////////////////
CBNamedObject::~CBNamedObject(void) {
- SAFE_DELETE_ARRAY(m_Name);
+ delete[] m_Name;
+ m_Name = NULL;
}
//////////////////////////////////////////////////////////////////////
void CBNamedObject::SetName(char *Name) {
- SAFE_DELETE_ARRAY(m_Name);
+ delete[] m_Name;
m_Name = new char [strlen(Name) + 1];
if (m_Name != NULL) strcpy(m_Name, Name);
diff --git a/engines/wintermute/UITiledImage.cpp b/engines/wintermute/UITiledImage.cpp index 488c1bdd7b..c85ea38a5e 100644 --- a/engines/wintermute/UITiledImage.cpp +++ b/engines/wintermute/UITiledImage.cpp @@ -58,7 +58,8 @@ CUITiledImage::CUITiledImage(CBGame *inGame): CBObject(inGame) { //////////////////////////////////////////////////////////////////////////
CUITiledImage::~CUITiledImage() {
- SAFE_DELETE(m_Image);
+ delete m_Image;
+ m_Image = NULL;
}
@@ -198,10 +199,11 @@ HRESULT CUITiledImage::LoadBuffer(byte *Buffer, bool Complete) { break;
case TOKEN_IMAGE:
- SAFE_DELETE(m_Image);
+ delete m_Image;
m_Image = new CBSubFrame(Game);
if (!m_Image || FAILED(m_Image->SetSurface((char *)params))) {
- SAFE_DELETE(m_Image);
+ delete m_Image;
+ m_Image = NULL;
cmd = PARSERR_GENERIC;
}
break;
diff --git a/engines/wintermute/UIWindow.cpp b/engines/wintermute/UIWindow.cpp index 8ef0f6df15..86e3eada49 100644 --- a/engines/wintermute/UIWindow.cpp +++ b/engines/wintermute/UIWindow.cpp @@ -329,37 +329,41 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) { break;
case TOKEN_BACK:
- SAFE_DELETE(m_Back);
+ delete m_Back;
m_Back = new CUITiledImage(Game);
if (!m_Back || FAILED(m_Back->LoadFile((char *)params))) {
- SAFE_DELETE(m_Back);
+ delete m_Back;
+ m_Back = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_BACK_INACTIVE:
- SAFE_DELETE(m_BackInactive);
+ delete m_BackInactive;
m_BackInactive = new CUITiledImage(Game);
if (!m_BackInactive || FAILED(m_BackInactive->LoadFile((char *)params))) {
- SAFE_DELETE(m_BackInactive);
+ delete m_BackInactive;
+ m_BackInactive = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_IMAGE:
- SAFE_DELETE(m_Image);
+ delete m_Image;
m_Image = new CBSprite(Game);
if (!m_Image || FAILED(m_Image->LoadFile((char *)params))) {
- SAFE_DELETE(m_Image);
+ delete m_Image;
+ m_Image = NULL;
cmd = PARSERR_GENERIC;
}
break;
case TOKEN_IMAGE_INACTIVE:
- SAFE_DELETE(m_ImageInactive),
+ delete m_ImageInactive,
m_ImageInactive = new CBSprite(Game);
if (!m_ImageInactive || FAILED(m_ImageInactive->LoadFile((char *)params))) {
- SAFE_DELETE(m_ImageInactive);
+ delete m_ImageInactive;
+ m_ImageInactive = NULL;
cmd = PARSERR_GENERIC;
}
break;
@@ -412,10 +416,11 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) { break;
case TOKEN_CURSOR:
- SAFE_DELETE(m_Cursor);
+ delete m_Cursor;
m_Cursor = new CBSprite(Game);
if (!m_Cursor || FAILED(m_Cursor->LoadFile((char *)params))) {
- SAFE_DELETE(m_Cursor);
+ delete m_Cursor;
+ m_Cursor = NULL;
cmd = PARSERR_GENERIC;
}
break;
@@ -423,7 +428,8 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) { case TOKEN_BUTTON: {
CUIButton *btn = new CUIButton(Game);
if (!btn || FAILED(btn->LoadBuffer(params, false))) {
- SAFE_DELETE(btn);
+ delete btn;
+ btn = NULL;
cmd = PARSERR_GENERIC;
} else {
btn->m_Parent = this;
@@ -435,7 +441,8 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) { case TOKEN_STATIC: {
CUIText *text = new CUIText(Game);
if (!text || FAILED(text->LoadBuffer(params, false))) {
- SAFE_DELETE(text);
+ delete text;
+ text = NULL;
cmd = PARSERR_GENERIC;
} else {
text->m_Parent = this;
@@ -447,7 +454,8 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) { case TOKEN_EDIT: {
CUIEdit *edit = new CUIEdit(Game);
if (!edit || FAILED(edit->LoadBuffer(params, false))) {
- SAFE_DELETE(edit);
+ delete edit;
+ edit = NULL;
cmd = PARSERR_GENERIC;
} else {
edit->m_Parent = this;
@@ -459,7 +467,8 @@ HRESULT CUIWindow::LoadBuffer(byte *Buffer, bool Complete) { case TOKEN_WINDOW: {
CUIWindow *win = new CUIWindow(Game);
if (!win || FAILED(win->LoadBuffer(params, false))) {
- SAFE_DELETE(win);
+ delete win;
+ win = NULL;
cmd = PARSERR_GENERIC;
} else {
win->m_Parent = this;
|