Skip to content

Commit 75ce1be

Browse files
committed
ICodec: complete destructor implementation
1 parent 286f602 commit 75ce1be

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/AvTranscoder/codec/ICodec.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ ICodec::ICodec( const ECodecType type, const AVCodecID codecId )
2828
setDecoderCodec( codecId );
2929
}
3030

31+
ICodec::~ICodec()
32+
{
33+
avcodec_close( _codecContext );
34+
av_free( _codecContext );
35+
_codecContext = NULL;
36+
}
37+
3138
std::string ICodec::getCodecName() const
3239
{
3340
assert( _codecContext != NULL );

src/AvTranscoder/codec/ICodec.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class AvExport ICodec
2727
ICodec( const ECodecType type, const std::string& codecName );
2828
ICodec( const ECodecType type, const AVCodecID codecId );
2929

30-
virtual ~ICodec() {};
30+
virtual ~ICodec();
3131

3232
std::string getCodecName() const;
3333
AVCodecID getCodecId() const;

0 commit comments

Comments
 (0)