summaryrefslogtreecommitdiff
path: root/src/frame.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-10-31 23:10:39 +0100
committerCarl Hetherington <cth@carlh.net>2020-11-02 00:12:56 +0100
commit809fe8c8e6f28c87f48e6629560a2b52a148a8a7 (patch)
treed2af064926ae732b7be3d82fb6fa4f4d412780e9 /src/frame.h
parent9e613ae8a3cd7994194d2d709f6ff9b88feac70b (diff)
Use some shared_ptr<> instead of raw pointers.
Diffstat (limited to 'src/frame.h')
-rw-r--r--src/frame.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/frame.h b/src/frame.h
index 6bd32104..69983c4a 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -49,18 +49,13 @@ public:
Frame (R* reader, int n, boost::shared_ptr<const DecryptionContext> c)
{
/* XXX: unfortunate guesswork on this buffer size */
- _buffer = new B (Kumu::Megabyte);
+ _buffer.reset(new B(Kumu::Megabyte));
if (ASDCP_FAILURE (reader->ReadFrame (n, *_buffer, c->context(), c->hmac()))) {
boost::throw_exception (ReadError ("could not read frame"));
}
}
- ~Frame ()
- {
- delete _buffer;
- }
-
uint8_t const * data () const
{
return _buffer->RoData ();
@@ -72,7 +67,7 @@ public:
}
private:
- B* _buffer;
+ boost::shared_ptr<B> _buffer;
};
}