archive/iso9660: use reference instead of pointer
This commit is contained in:
parent
dbda35ffe1
commit
c95d068ef5
|
@ -142,7 +142,7 @@ Iso9660ArchiveFile::Visit(ArchiveVisitor &visitor)
|
|||
class Iso9660InputStream {
|
||||
InputStream base;
|
||||
|
||||
Iso9660ArchiveFile *archive;
|
||||
Iso9660ArchiveFile &archive;
|
||||
|
||||
iso9660_stat_t *statbuf;
|
||||
|
||||
|
@ -151,16 +151,16 @@ public:
|
|||
Mutex &mutex, Cond &cond,
|
||||
iso9660_stat_t *_statbuf)
|
||||
:base(iso9660_input_plugin, uri, mutex, cond),
|
||||
archive(&_archive), statbuf(_statbuf) {
|
||||
archive(_archive), statbuf(_statbuf) {
|
||||
base.ready = true;
|
||||
base.size = statbuf->size;
|
||||
|
||||
archive->Ref();
|
||||
archive.Ref();
|
||||
}
|
||||
|
||||
~Iso9660InputStream() {
|
||||
free(statbuf);
|
||||
archive->Unref();
|
||||
archive.Unref();
|
||||
}
|
||||
|
||||
InputStream *Get() {
|
||||
|
@ -216,7 +216,7 @@ Iso9660InputStream::Read(void *ptr, size_t size, Error &error)
|
|||
|
||||
cur_block = base.offset / ISO_BLOCKSIZE;
|
||||
|
||||
readed = archive->SeekRead(ptr, statbuf->lsn + cur_block,
|
||||
readed = archive.SeekRead(ptr, statbuf->lsn + cur_block,
|
||||
no_blocks);
|
||||
|
||||
if (readed != no_blocks * ISO_BLOCKSIZE) {
|
||||
|
|
Loading…
Reference in New Issue