Actually manage memory in the old-style AOS logging
LeakSanitizer should be happy with it now. It's also still just as
thread-safe.
Change-Id: Id09a0349657cf4f719267b053f0ea3d8ec366256
diff --git a/y2019/image_streamer/image_streamer.cc b/y2019/image_streamer/image_streamer.cc
index 6f8027c..1252627 100644
--- a/y2019/image_streamer/image_streamer.cc
+++ b/y2019/image_streamer/image_streamer.cc
@@ -309,7 +309,7 @@
gflags::ParseCommandLineFlags(&argc, &argv, false);
::aos::logging::Init();
::aos::logging::SetImplementation(
- new ::aos::logging::StreamLogImplementation(stderr));
+ std::make_shared<::aos::logging::StreamLogImplementation>(stderr));
TCPServer<MjpegDataSocket> tcp_server_(80);
aos::vision::CameraParams params0;
params0.set_exposure(FLAGS_camera0_exposure);
diff --git a/y2019/vision/debug_serial.cc b/y2019/vision/debug_serial.cc
index c707d1f..18670c0 100644
--- a/y2019/vision/debug_serial.cc
+++ b/y2019/vision/debug_serial.cc
@@ -25,7 +25,7 @@
// gflags::ParseCommandLineFlags(&argc, &argv, false);
::aos::logging::Init();
::aos::logging::SetImplementation(
- new ::aos::logging::StreamLogImplementation(stderr));
+ std::make_shared<::aos::logging::StreamLogImplementation>(stderr));
int flags = fcntl(0, F_GETFL, 0);
fcntl(0, F_SETFL, flags | O_NONBLOCK);
diff --git a/y2019/vision/global_calibration.cc b/y2019/vision/global_calibration.cc
index 52a6e52..af2ad54 100644
--- a/y2019/vision/global_calibration.cc
+++ b/y2019/vision/global_calibration.cc
@@ -104,7 +104,7 @@
::aos::logging::Init();
::aos::logging::SetImplementation(
- new ::aos::logging::StreamLogImplementation(stderr));
+ std::make_shared<::aos::logging::StreamLogImplementation>(stderr));
TargetFinder target_finder;