diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-11-02 14:11:03 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-11-02 14:11:03 +0000 |
commit | 29f07d2f98b82674708f1185f26ed3c482992b04 (patch) | |
tree | 941c44de1a711fc458ad65bd5afcb57ea759f489 | |
parent | f555abfda840099d34af90fe3682acce09fe5fdf (diff) | |
download | mana-29f07d2f98b82674708f1185f26ed3c482992b04.tar.gz mana-29f07d2f98b82674708f1185f26ed3c482992b04.tar.bz2 mana-29f07d2f98b82674708f1185f26ed3c482992b04.tar.xz mana-29f07d2f98b82674708f1185f26ed3c482992b04.zip |
Fixed a memory leak and a double deletion.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/gui/register.cpp | 8 | ||||
-rw-r--r-- | src/gui/register.h | 1 |
3 files changed, 5 insertions, 6 deletions
@@ -1,5 +1,7 @@ 2006-11-02 Björn Steinbrink <B.Steinbrink@gmx.de> + * src/gui/register.cpp, src/gui/register.h: Fixed a memory leak and a + double deletion. * src/main.cpp, src/CMakeLists.txt, src/net/loginhandler.cpp, src/net/charserverhandler.h, src/net/maploginhandler.h, src/net/maploginhandler.cpp, src/net/loginhandler.h, src/Makefile.am: diff --git a/src/gui/register.cpp b/src/gui/register.cpp index 00880352..7cef62a2 100644 --- a/src/gui/register.cpp +++ b/src/gui/register.cpp @@ -44,7 +44,6 @@ RegisterDialog::RegisterDialog(LoginData *loginData): Window("Register"), mWrongDataNoticeListener(new WrongDataNoticeListener()), - mWrongRegisterNotice(0), mLoginData(loginData) { gcn::Label *userLabel = new gcn::Label("Name:"); @@ -104,7 +103,7 @@ RegisterDialog::RegisterDialog(LoginData *loginData): RegisterDialog::~RegisterDialog() { - delete mWrongRegisterNotice; + delete mWrongDataNoticeListener; } void @@ -183,9 +182,8 @@ RegisterDialog::action(const std::string &eventId, gcn::Widget *widget) mConfirmField->setText(""); } - delete mWrongRegisterNotice; - mWrongRegisterNotice = new OkDialog("Error", errorMsg.str()); - mWrongRegisterNotice->addActionListener(mWrongDataNoticeListener); + OkDialog *dlg = new OkDialog("Error", errorMsg.str()); + dlg->addActionListener(mWrongDataNoticeListener); } else { diff --git a/src/gui/register.h b/src/gui/register.h index 8551b9e0..4c98788f 100644 --- a/src/gui/register.h +++ b/src/gui/register.h @@ -71,7 +71,6 @@ class RegisterDialog : public Window, public gcn::ActionListener { gcn::Button *mCancelButton; WrongDataNoticeListener *mWrongDataNoticeListener; - OkDialog *mWrongRegisterNotice; LoginData *mLoginData; }; |