[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master d8a7b0a 1/7: Improve resource management in o
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master d8a7b0a 1/7: Improve resource management in one instance |
Date: |
Wed, 10 Feb 2021 09:41:59 -0500 (EST) |
branch: master
commit d8a7b0ab74748a0fae38af19153694815fa8d1f3
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Improve resource management in one instance
The object used for the pasting text is intended to be deleted when
that test completes. An exception could have kept the Destroy() call
from being reached. See:
https://lists.nongnu.org/archive/html/lmi/2021-02/msg00014.html
---
skeleton.cpp | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/skeleton.cpp b/skeleton.cpp
index 267582e..d3f57da 100644
--- a/skeleton.cpp
+++ b/skeleton.cpp
@@ -1081,7 +1081,11 @@ void
Skeleton::UponTestFloatingPointEnvironment(wxCommandEvent&)
void Skeleton::UponTestPasting(wxCommandEvent&)
{
- InputSequenceEntry* z = new(wx) InputSequenceEntry(frame_, wxID_ANY,
"Testing...");
+ auto const z = std::make_unique<InputSequenceEntry>
+ (frame_
+ ,wxID_ANY
+ ,"Testing..."
+ );
wxTextCtrl& t = z->text_ctrl();
ClipboardEx::SetText("1\r\n2\r\n3\r\n");
@@ -1100,7 +1104,6 @@ void Skeleton::UponTestPasting(wxCommandEvent&)
warning() << "'X;Y;Z;' != '" << t.GetValue() << "'" << LMI_FLUSH;
}
- z->Destroy();
status() << "Pasting test finished." << std::flush;
}
- [lmi-commits] [lmi] master updated (ff677ea -> ba6aec6), Greg Chicares, 2021/02/10
- [lmi-commits] [lmi] master 7b3f6ad 2/7: Use the 2021 transitional 7702 rate for one sample product, Greg Chicares, 2021/02/10
- [lmi-commits] [lmi] master d8a7b0a 1/7: Improve resource management in one instance,
Greg Chicares <=
- [lmi-commits] [lmi] master a598792 5/7: Further augment a sed script, Greg Chicares, 2021/02/10
- [lmi-commits] [lmi] master d26f4b2 4/7: Augment a sed script, Greg Chicares, 2021/02/10
- [lmi-commits] [lmi] master ba6aec6 7/7: Import webpages, Greg Chicares, 2021/02/10
- [lmi-commits] [lmi] master 5965057 3/7: Avoid writing the 1984-era 7702 rate literally, Greg Chicares, 2021/02/10
- [lmi-commits] [lmi] master 6cfbaf4 6/7: Prefer https to http in user manual, Greg Chicares, 2021/02/10