Browse Source

Move MENU_ABOUT related objects into the MENU_ABOUT handler to avoid memory leaks.

master
Reece H. Dunn 9 years ago
parent
commit
a23c5a6f76
1 changed files with 4 additions and 7 deletions
  1. 4
    7
      src/espeakedit.cpp

+ 4
- 7
src/espeakedit.cpp View File

char buf[300]; char buf[300];
wxString url_docs; wxString url_docs;


wxBoxSizer *topsizer;
HtmlWindow *html;
wxDialog dlg(this, wxID_ANY, wxString(_("About")));

topsizer = new wxBoxSizer(wxVERTICAL);

switch(event.GetId()) switch(event.GetId())
{ {
case MENU_ABOUT: case MENU_ABOUT:
{ {
wxDialog dlg(this, wxID_ANY, wxString(_("About")));

sprintf(buf,about_string,espeak_Info(NULL)); sprintf(buf,about_string,espeak_Info(NULL));
html = new HtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER);
HtmlWindow *html = new HtmlWindow(&dlg, wxID_ANY, wxDefaultPosition, wxSize(380, 160), wxHW_SCROLLBAR_NEVER);
html -> SetBorders(0); html -> SetBorders(0);
html -> SetPage(wxString(buf,wxConvLocal)); html -> SetPage(wxString(buf,wxConvLocal));
html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(), html -> SetSize(html -> GetInternalRepresentation() -> GetWidth(),
html -> GetInternalRepresentation() -> GetHeight()); html -> GetInternalRepresentation() -> GetHeight());


wxBoxSizer *topsizer = new wxBoxSizer(wxVERTICAL);
topsizer -> Add(html, 1, wxALL, 10); topsizer -> Add(html, 1, wxALL, 10);


//#if wxUSE_STATLINE //#if wxUSE_STATLINE

Loading…
Cancel
Save