Skip to content

Commit

Permalink
AURORA: Use ScopedPtr in the GFF classes
Browse files Browse the repository at this point in the history
  • Loading branch information
DrMcCoy committed Oct 29, 2016
1 parent 1daf31b commit 884e76c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/aurora/gff3file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ GFF3File::~GFF3File() {
}

void GFF3File::clear() {
delete _stream;
_stream = 0;
_stream.reset();

for (StructArray::iterator strct = _structs.begin(); strct != _structs.end(); ++strct)
delete *strct;
Expand Down
3 changes: 2 additions & 1 deletion src/aurora/gff3file.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <boost/noncopyable.hpp>

#include "src/common/types.h"
#include "src/common/scopedptr.h"
#include "src/common/ustring.h"

#include "src/aurora/types.h"
Expand Down Expand Up @@ -112,7 +113,7 @@ class GFF3File : boost::noncopyable, public AuroraFile {
typedef std::vector<GFF3List> ListArray;


Common::SeekableReadStream *_stream;
Common::ScopedPtr<Common::SeekableReadStream> _stream;

Header _header; ///< The GFF3's header.

Expand Down
3 changes: 1 addition & 2 deletions src/aurora/gff4file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ GFF4File::~GFF4File() {
}

void GFF4File::clear() {
delete _stream;
_stream = 0;
_stream.reset();

for (StructMap::iterator s = _structs.begin(); s != _structs.end(); ++s)
delete s->second;
Expand Down
3 changes: 2 additions & 1 deletion src/aurora/gff4file.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <boost/noncopyable.hpp>

#include "src/common/types.h"
#include "src/common/scopedptr.h"
#include "src/common/ustring.h"
#include "src/common/encoding.h"

Expand Down Expand Up @@ -129,7 +130,7 @@ class GFF4File : boost::noncopyable, public AuroraFile {



Common::SeekableReadStream *_stream;
Common::ScopedPtr<Common::SeekableReadStream> _stream;

/** This GFF4's header. */
Header _header;
Expand Down

0 comments on commit 884e76c

Please sign in to comment.