mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r17559) -Fix [FS#3206]: close the "Add NewGRF" window when you close the "NewGRF Settings" window. The add window has a pointer to the settings which means that not deleting it would cause dereferencing an already freed pointer
This commit is contained in:
parent
430ce19418
commit
1f1161f10d
|
@ -236,8 +236,9 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
NewGRFAddWindow(const WindowDesc *desc, GRFConfig **list) : QueryStringBaseWindow(EDITBOX_MAX_SIZE)
|
NewGRFAddWindow(const WindowDesc *desc, Window *parent, GRFConfig **list) : QueryStringBaseWindow(EDITBOX_MAX_SIZE)
|
||||||
{
|
{
|
||||||
|
this->parent = parent;
|
||||||
this->InitNested(desc, 0);
|
this->InitNested(desc, 0);
|
||||||
|
|
||||||
InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, EDITBOX_MAX_LENGTH);
|
InitializeTextBuffer(&this->text, this->edit_str_buf, this->edit_str_size, EDITBOX_MAX_LENGTH);
|
||||||
|
@ -731,7 +732,7 @@ struct NewGRFWindow : public Window {
|
||||||
|
|
||||||
case SNGRFS_ADD: // Add GRF
|
case SNGRFS_ADD: // Add GRF
|
||||||
DeleteWindowByClass(WC_SAVELOAD);
|
DeleteWindowByClass(WC_SAVELOAD);
|
||||||
new NewGRFAddWindow(&_newgrf_add_dlg_desc, &this->list);
|
new NewGRFAddWindow(&_newgrf_add_dlg_desc, this, &this->list);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SNGRFS_REMOVE: { // Remove GRF
|
case SNGRFS_REMOVE: { // Remove GRF
|
||||||
|
|
Loading…
Reference in New Issue