Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TsubtitleParser : public TsubtitleParserBase { .... }
- class TsubtitleParserSubrip09 : public TsubtitleParser { .... }
- // Factory Pattern
- TsubtitleParserBase* TsubtitleParserBase::getParser(
- int format, double fps, const TsubtitlesSettings *cfg,
- const Tconfig *ffcfg, Tsubreader *subreader,
- bool utf8, bool isEmbedded)
- {
- switch (format & Tsubreader::SUB_FORMATMASK) {
- case Tsubreader::SUB_MICRODVD :
- return new TsubtitleParserMicrodvd(...);
- case Tsubreader::SUB_SUBRIP :
- return new TsubtitleParserSubrip(...);
- case Tsubreader::SUB_SUBVIEWER :
- return new TsubtitleParserSubviewer(...);
- case Tsubreader::SUB_SAMI :
- return new TsubtitleParserSami(...);
- case Tsubreader::SUB_VPLAYER :
- return new TsubtitleParserVplayer(...);
- case Tsubreader::SUB_RT :
- return new TsubtitleParserRt(...);
- case Tsubreader::SUB_SSA :
- return new TsubtitleParserSSA(..., isEmbedded);
- case Tsubreader::SUB_DUNNOWHAT :
- return new TsubtitleParserDunnowhat(...);
- case Tsubreader::SUB_MPSUB :
- return new TsubtitleParserMPsub(...);
- case Tsubreader::SUB_AQTITLE :
- return new TsubtitleParserAqt(...);
- case Tsubreader::SUB_SUBVIEWER2:
- return new TsubtitleParserSubviewer2(...);
- case Tsubreader::SUB_SUBRIP09 :
- return new TsubtitleParserSubrip09(...);
- case Tsubreader::SUB_MPL2 :
- return new TsubtitleParserMPL2(...);
- default:
- return NULL;
- }
- }
- TsubtitleParserBase *parser;
- parser = TsubtitleParserBase::getParser(
- type, fps1000 / 1000.0, cfg, ffcfg, subs, utf8, true);
- TsubtitlesTextpinText::~TsubtitlesTextpinText()
- {
- if (parser) {
- delete parser;
- }
- }
- A destructor is absent in TsubtitleParserBase. A virtual destructor is needed.
- This suspicious code was found in ffdshow project by PVS-Studio static code analyzer.
- Warning message is:
- V599 The virtual destructor is not present, although the 'TsubtitleParserBase' class contains virtual functions. tsubtitlestextpintext.cpp 41
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment