Skip to content

Commit

Permalink
Whoops, license dialog's sizer will delete its wxTextCtrl, so don't s…
Browse files Browse the repository at this point in the history
…tore or

 delete it ourselves.
  • Loading branch information
icculus committed Feb 20, 2007
1 parent 39fd239 commit 788f94d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/toby_wxwidgets.cpp
Expand Up @@ -218,7 +218,6 @@ class TobyLicenseDialog : public wxDialog
{
public:
TobyLicenseDialog(wxWindow *parent);
virtual ~TobyLicenseDialog() { delete this->textCtrl; }
void onOK(wxCommandEvent &evt);

enum
Expand All @@ -228,7 +227,6 @@ class TobyLicenseDialog : public wxDialog
};

private:
wxTextCtrl *textCtrl;
DECLARE_EVENT_TABLE()
};

Expand Down Expand Up @@ -1049,7 +1047,6 @@ void TobyFrame::onMenuAbout(wxCommandEvent &evt)

TobyLicenseDialog::TobyLicenseDialog(wxWindow *parent)
: wxDialog(parent, -1, wxT("License"), wxDefaultPosition, wxDefaultSize, dlgFlags)
, textCtrl(NULL)
{
::wxBeginBusyCursor();

Expand All @@ -1061,7 +1058,7 @@ TobyLicenseDialog::TobyLicenseDialog(wxWindow *parent)
int dpyw, dpyh;
::wxDisplaySize(&dpyw, &dpyh);

this->textCtrl = new wxTextCtrl(this, wxID_ANY,
wxTextCtrl *textCtrl = new wxTextCtrl(this, wxID_ANY,
wxString(GLicense, wxConvUTF8),
wxDefaultPosition, wxSize(dpyw/2, dpyh/2),
wxTE_READONLY | wxTE_MULTILINE);
Expand All @@ -1080,7 +1077,7 @@ TobyLicenseDialog::TobyLicenseDialog(wxWindow *parent)
topsizer->Fit(this);

this->Centre(wxBOTH);
this->textCtrl->SetFocus();
textCtrl->SetFocus();

::wxEndBusyCursor();
} // TobyLicenseDialog::TobyLicenseDialog
Expand Down

0 comments on commit 788f94d

Please sign in to comment.