Skip to content
This repository was archived by the owner on Feb 12, 2022. It is now read-only.

Commit 236c0ff

Browse files
authored
Fix segmentation fault (#82)
1 parent 968bdaf commit 236c0ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cloudwatch_logger/src/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515

16+
#include <aws/core/Aws.h>
1617
#include <aws/core/utils/logging/LogMacros.h>
1718
#include <aws_common/sdk_utils/client_configuration_provider.h>
1819
#include <cloudwatch_logger/log_node.h>
@@ -29,6 +30,8 @@ constexpr char kNodeName[] = "cloudwatch_logger";
2930

3031
int main(int argc, char ** argv)
3132
{
33+
Aws::SDKOptions options;
34+
Aws::InitAPI(options);
3235
Aws::Utils::Logging::InitializeAWSLogging(
3336
Aws::MakeShared<Aws::Utils::Logging::AWSROSLogger>(kNodeName));
3437
ros::init(argc, argv, kNodeName);
@@ -100,6 +103,7 @@ int main(int argc, char ** argv)
100103
cloudwatch_logger.shutdown();
101104
Aws::Utils::Logging::ShutdownAWSLogging();
102105
ros::shutdown();
106+
Aws::ShutdownAPI(options);
103107

104108
return 0;
105109
}

0 commit comments

Comments
 (0)