diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-03-28 00:39:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-03-28 11:04:23 +0300 |
commit | 0c35dab0ba366f85b40ef1795125521f1df8c264 (patch) | |
tree | dde6abde3288f543ae96a2468b2275af8a03e704 /src/gui/windows/npcdialog.cpp | |
parent | 47cc515695fcd0b16467506e4984d2ec38fad4e4 (diff) | |
download | plus-0c35dab0ba366f85b40ef1795125521f1df8c264.tar.gz plus-0c35dab0ba366f85b40ef1795125521f1df8c264.tar.bz2 plus-0c35dab0ba366f85b40ef1795125521f1df8c264.tar.xz plus-0c35dab0ba366f85b40ef1795125521f1df8c264.zip |
simplify variables cleanup.
Diffstat (limited to 'src/gui/windows/npcdialog.cpp')
-rw-r--r-- | src/gui/windows/npcdialog.cpp | 59 |
1 files changed, 19 insertions, 40 deletions
diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 17ff9a8c1..56306a90f 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -57,6 +57,7 @@ #include "net/npchandler.h" #include "utils/copynpaste.h" +#include "utils/delete2.h" #include "utils/gettext.h" #include "debug.h" @@ -216,44 +217,23 @@ NpcDialog::~NpcDialog() delete mPlayerBox; } - delete mTextBox; - mTextBox = nullptr; - delete mClearButton; - mClearButton = nullptr; - delete mButton; - mButton = nullptr; - delete mButton2; - mButton2 = nullptr; - delete mButton3; - mButton3 = nullptr; - - // These might not actually be in the layout, so lets be safe - delete mScrollArea; - mScrollArea = nullptr; - delete mItemList; - mItemList = nullptr; - delete mTextField; - mTextField = nullptr; - delete mIntField; - mIntField = nullptr; - delete mResetButton; - mResetButton = nullptr; - delete mPlusButton; - mPlusButton = nullptr; - delete mMinusButton; - mMinusButton = nullptr; - delete mItemLinkHandler; - mItemLinkHandler = nullptr; - - delete mItemContainer; - mItemContainer = nullptr; - delete mInventory; - mInventory = nullptr; - delete mItemScrollArea; - mItemScrollArea = nullptr; - - delete mListScrollArea; - mListScrollArea = nullptr; + delete2(mTextBox); + delete2(mClearButton); + delete2(mButton); + delete2(mButton2); + delete2(mButton3); + delete2(mScrollArea); + delete2(mItemList); + delete2(mTextField); + delete2(mIntField); + delete2(mResetButton); + delete2(mPlusButton); + delete2(mMinusButton); + delete2(mItemLinkHandler); + delete2(mItemContainer); + delete2(mInventory); + delete2(mItemScrollArea); + delete2(mListScrollArea); FOR_EACH (ImageVectorIter, it, mImages) { @@ -896,8 +876,7 @@ void NpcDialog::showAvatar(const uint16_t avatarId) } else { - delete mAvatarBeing; - mAvatarBeing = nullptr; + delete2(mAvatarBeing) mPlayerBox->setPlayer(nullptr); } if (needShow != mShowAvatar) |