mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
flac: fix leak; properly close stream upon closing FlacAudioCursor
This commit is contained in:
parent
da079c5ffe
commit
5dd0db300b
@ -59,7 +59,8 @@ FlacAudioCursor::
|
||||
FlacAudioCursor(FlacAudio *src, std::istream *stream) :
|
||||
MovieAudioCursor(src),
|
||||
_is_valid(false),
|
||||
_drflac(nullptr)
|
||||
_drflac(nullptr),
|
||||
_stream(stream)
|
||||
{
|
||||
nassertv(stream != nullptr);
|
||||
nassertv(stream->good());
|
||||
@ -91,6 +92,9 @@ FlacAudioCursor::
|
||||
if (_drflac != nullptr) {
|
||||
drflac_close(_drflac);
|
||||
}
|
||||
if (_stream != nullptr) {
|
||||
VirtualFileSystem::close_read_file(_stream);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -41,6 +41,7 @@ public:
|
||||
|
||||
protected:
|
||||
drflac *_drflac;
|
||||
std::istream *_stream;
|
||||
|
||||
public:
|
||||
static TypeHandle get_class_type() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user