mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 05:16:58 +00:00
ccmake: Free long message form before its field
free_field() refuses to free a field that is still connected to a form and returns E_CONNECTED. ~cmCursesLongMessageForm freed its field before the base class destructor freed the form, so the field and its buffer leaked every time a long message form was destroyed.
This commit is contained in:
1 parent
cfb3000e9e
commit
1835cffe66
1 file changed
+6
@@ -30,6 +30,12 @@ cmCursesLongMessageForm::cmCursesLongMessageForm(
|
||||
|
||||
cmCursesLongMessageForm::~cmCursesLongMessageForm()
|
||||
{
|
||||
// The field cannot be freed while it is connected to the form
|
||||
if (this->Form) {
|
||||
unpost_form(this->Form);
|
||||
free_form(this->Form);
|
||||
this->Form = nullptr;
|
||||
}
|
||||
if (this->Fields[0]) {
|
||||
free_field(this->Fields[0]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user