diff options
-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; }; |