InputStream: add virtual destructor
Replaces the method Close().
This commit is contained in:
@@ -31,6 +31,10 @@
|
||||
|
||||
static constexpr Domain input_domain("input");
|
||||
|
||||
InputStream::~InputStream()
|
||||
{
|
||||
}
|
||||
|
||||
InputStream *
|
||||
InputStream::Open(const char *url,
|
||||
Mutex &mutex, Cond &cond,
|
||||
@@ -41,7 +45,6 @@ InputStream::Open(const char *url,
|
||||
|
||||
is = plugin->open(url, mutex, cond, error);
|
||||
if (is != nullptr) {
|
||||
assert(is->plugin.close != nullptr);
|
||||
assert(is->plugin.read != nullptr);
|
||||
assert(is->plugin.eof != nullptr);
|
||||
assert(!is->seekable || is->plugin.seek != nullptr);
|
||||
@@ -72,7 +75,7 @@ InputStream::OpenReady(const char *uri,
|
||||
mutex.unlock();
|
||||
|
||||
if (!success) {
|
||||
is->Close();
|
||||
delete is;
|
||||
is = nullptr;
|
||||
}
|
||||
|
||||
@@ -202,12 +205,6 @@ InputStream::LockRead(void *ptr, size_t _size, Error &error)
|
||||
return Read(ptr, _size, error);
|
||||
}
|
||||
|
||||
void
|
||||
InputStream::Close()
|
||||
{
|
||||
plugin.close(this);
|
||||
}
|
||||
|
||||
bool
|
||||
InputStream::IsEOF()
|
||||
{
|
||||
|
Reference in New Issue
Block a user