diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-16 14:02:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-19 08:58:46 +0200 |
commit | 96c85e7d107ad0d79295349f01cd8578ce7daeba (patch) | |
tree | c205fda67414559b325ab94b8e8dfff753d9ee4c /hwpfilter/source/hwpfile.cxx | |
parent | 61bfcf16dc6e4cedcd82b51a646b89909f035f2d (diff) |
loplugin:useuniqueptr in hwpfilter
Change-Id: Id276015425ea7de3cf55b9ef21b4e7ce54c2ce47
Diffstat (limited to 'hwpfilter/source/hwpfile.cxx')
-rw-r--r-- | hwpfilter/source/hwpfile.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx index 128be0caa7af..13d1416ece4b 100644 --- a/hwpfilter/source/hwpfile.cxx +++ b/hwpfilter/source/hwpfile.cxx @@ -61,8 +61,8 @@ HWPFile::HWPFile() HWPFile::~HWPFile() { - delete oledata; - delete hiodev; + oledata.reset(); + hiodev.reset(); } int HWPFile::ReadHwpFile(HStream * stream) @@ -185,9 +185,9 @@ void HWPFile::SetCompressed(bool flag) HIODev *HWPFile::SetIODevice(HIODev * new_hiodev) { - HIODev *old_hiodev = hiodev; + HIODev *old_hiodev = hiodev.release(); - hiodev = new_hiodev; + hiodev.reset( new_hiodev ); return old_hiodev; } @@ -316,8 +316,7 @@ void HWPFile::TagsRead() } break; case FILETAG_OLE_OBJECT: - delete oledata; - oledata = new OlePicture(size); + oledata.reset( new OlePicture(size) ); oledata->Read(*this); break; case FILETAG_HYPERTEXT: |