This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH setup 1/3] Make sure that the IniDBBuilderPackage destructor is called when needed
- From: Ken Brown <kbrown at cornell dot edu>
- To: cygwin-apps at cygwin dot com
- Date: Sat, 17 Mar 2018 10:59:53 -0400
- Subject: [PATCH setup 1/3] Make sure that the IniDBBuilderPackage destructor is called when needed
- References: <20180317145955.4944-1-kbrown@cornell.edu>
The IniDBBuilderPackage destructor contains code that is intended to
be run after each setup.ini file is processed. But the
IniDBBuilderPackage variables in do_local_ini() and do_remote_ini were
declared outside the loop that processed the files. Move the
declaration inside the loop so that the destructor is called after
each iteration.
---
ini.cc | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ini.cc b/ini.cc
index d807ed6..7afeba2 100644
--- a/ini.cc
+++ b/ini.cc
@@ -209,13 +209,13 @@ static bool
do_local_ini (HWND owner)
{
bool ini_error = false;
- GuiParseFeedback myFeedback;
- IniDBBuilderPackage aBuilder (myFeedback);
io_stream *ini_file, *ini_sig_file;
// iterate over all setup files found in do_from_local_dir
for (IniList::const_iterator n = found_ini_list.begin ();
n != found_ini_list.end (); ++n)
{
+ GuiParseFeedback myFeedback;
+ IniDBBuilderPackage aBuilder (myFeedback);
bool sig_fail = false;
std::string current_ini_ext, current_ini_name, current_ini_sig_name;
@@ -268,8 +268,6 @@ static bool
do_remote_ini (HWND owner)
{
bool ini_error = false;
- GuiParseFeedback myFeedback;
- IniDBBuilderPackage aBuilder (myFeedback);
io_stream *ini_file = NULL, *ini_sig_file;
/* FIXME: Get rid of this io_stream pointer travesty. The need to
@@ -279,6 +277,8 @@ do_remote_ini (HWND owner)
for (SiteList::const_iterator n = site_list.begin ();
n != site_list.end (); ++n)
{
+ GuiParseFeedback myFeedback;
+ IniDBBuilderPackage aBuilder (myFeedback);
bool sig_fail = false;
std::string current_ini_ext, current_ini_name, current_ini_sig_name;
// iterate over known extensions for setup
--
2.16.2