aboutsummaryrefslogtreecommitdiff
path: root/engines/drascula/resource.cpp
diff options
context:
space:
mode:
authorChristoph Mallon2011-08-06 16:30:52 +0200
committerChristoph Mallon2011-08-07 15:19:08 +0200
commita5a8833c059f28c85e392a3cd22c361d38ef95ff (patch)
tree3b3b69326019444c2c375c66f39cb3013a003591 /engines/drascula/resource.cpp
parent2f23ff72c1d804d9d0e3ac09c46f52fd6b23a68c (diff)
downloadscummvm-rg350-a5a8833c059f28c85e392a3cd22c361d38ef95ff.tar.gz
scummvm-rg350-a5a8833c059f28c85e392a3cd22c361d38ef95ff.tar.bz2
scummvm-rg350-a5a8833c059f28c85e392a3cd22c361d38ef95ff.zip
COMMON: Add DisposablePtr<T>, which replaces many repeated implementations of a dispose flag.
Diffstat (limited to 'engines/drascula/resource.cpp')
-rw-r--r--engines/drascula/resource.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/engines/drascula/resource.cpp b/engines/drascula/resource.cpp
index 61609fb940..95a95e3487 100644
--- a/engines/drascula/resource.cpp
+++ b/engines/drascula/resource.cpp
@@ -42,7 +42,7 @@ Common::SeekableReadStream *ArchiveMan::open(const Common::String &filename) {
}
TextResourceParser::TextResourceParser(Common::SeekableReadStream *stream, DisposeAfterUse::Flag dispose) :
- _stream(stream), _dispose(dispose) {
+ _stream(stream, dispose) {
// NOTE: strangely enough, the code before this refactoring used the size of
// the stream as a fixed maximum length for the parser. Using an updated
@@ -50,12 +50,6 @@ TextResourceParser::TextResourceParser(Common::SeekableReadStream *stream, Dispo
_maxLen = _stream->size();
}
-TextResourceParser::~TextResourceParser() {
- if (_dispose == DisposeAfterUse::YES) {
- delete _stream;
- }
-}
-
void TextResourceParser::getLine(char *buf) {
byte c;
char *b;