diff options
| -rw-r--r-- | src/TimestampDecoder.cpp | 6 | ||||
| -rw-r--r-- | src/TimestampDecoder.h | 3 | 
2 files changed, 5 insertions, 4 deletions
diff --git a/src/TimestampDecoder.cpp b/src/TimestampDecoder.cpp index b03ecbb..5044366 100644 --- a/src/TimestampDecoder.cpp +++ b/src/TimestampDecoder.cpp @@ -29,6 +29,7 @@  #include <fstream>  #include <string>  #include <boost/lexical_cast.hpp> +#include <boost/make_shared.hpp>  #include <sys/types.h>  #include "PcDebug.h"  #include "TimestampDecoder.h" @@ -41,7 +42,8 @@  void TimestampDecoder::calculateTimestamp(struct frame_timestamp& ts)  { -    struct frame_timestamp* ts_queued = new struct frame_timestamp; +    boost::shared_ptr<struct frame_timestamp> ts_queued = +        boost::make_shared<struct frame_timestamp>();      /* Push new timestamp into queue */      ts_queued->timestamp_valid = full_timestamp_received_mnsc; @@ -87,8 +89,6 @@ void TimestampDecoder::calculateTimestamp(struct frame_timestamp& ts)                  ts.timestamp_sec,                  ts.timestamp_pps_offset,                  ts.timestamp_refresh);*/ - -        delete ts_queued;      }      MDEBUG("Timestamp queue size %zu, delay_calc %u\n", diff --git a/src/TimestampDecoder.h b/src/TimestampDecoder.h index 1b805ca..d8ab633 100644 --- a/src/TimestampDecoder.h +++ b/src/TimestampDecoder.h @@ -28,6 +28,7 @@  #define TIMESTAMP_DECODER_H  #include <queue> +#include <boost/shared_ptr.hpp>  #include <string>  #include <time.h>  #include <math.h> @@ -191,7 +192,7 @@ class TimestampDecoder : public RemoteControllable           * synchronise two modulators if only one uses (for instance) the           * FIRFilter (1 stage pipeline)           */ -        std::queue<struct frame_timestamp*> queue_timestamps; +        std::queue<boost::shared_ptr<struct frame_timestamp> > queue_timestamps;  };  | 
