mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 05:16:58 +00:00
ccmake: Delete main form on exit after a failed configure
When Configure() or Generate() failed with -2 (e.g. no CMakeLists.txt in the source directory) they returned while CurrentForm still pointed at the message form. main() then deleted that form instead of the main form, leaking the main form together with its cmake instance.
This commit is contained in:
1 parent
5532f2c69d
commit
952a327c7b
2 files changed
+3
-1
No files matched your search
@@ -186,8 +186,8 @@ int main(int argc, char const* const* argv)
|
||||
clear();
|
||||
touchwin(stdscr);
|
||||
endwin();
|
||||
delete cmCursesForm::CurrentForm;
|
||||
cmCursesForm::CurrentForm = nullptr;
|
||||
delete myform;
|
||||
|
||||
std::cout << std::endl << std::endl;
|
||||
|
||||
|
||||
@@ -537,6 +537,7 @@ int cmCursesMainForm::Configure(int noconfigure)
|
||||
// If they typed the wrong source directory, we report
|
||||
// an error and exit
|
||||
if (retVal == -2) {
|
||||
CurrentForm = this;
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
@@ -590,6 +591,7 @@ int cmCursesMainForm::Generate()
|
||||
// If they typed the wrong source directory, we report
|
||||
// an error and exit
|
||||
if (retVal == -2) {
|
||||
CurrentForm = this;
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user