From d79f5f3ce6fd2a349f454bc14b3b7ad0897af7ed Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 7 May 2020 14:43:39 -0700 Subject: [PATCH] core: (postfix commit 5b95df87) return to invoke locally scoped destructors --- examples/naming/object-names.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/examples/naming/object-names.cc b/examples/naming/object-names.cc index 649184277..0e3b493b2 100644 --- a/examples/naming/object-names.cc +++ b/examples/naming/object-names.cc @@ -207,13 +207,9 @@ main (int argc, char *argv[]) outputValidated = false; } - if (outputValidated) + if (outputValidated == false) { - exit (0); - } - else - { - std::cerr << "Program internal checking failed; exiting with error" << std::endl; - exit (1); + std::cerr << "Program internal checking failed; returning with error" << std::endl; + return (1); } }