Fix warnings about missing virtual destructors

This commit is contained in:
Urs Fleisch 2023-07-02 17:04:36 +02:00
parent a33cc0635a
commit 250dece2ab
5 changed files with 24 additions and 10 deletions

View File

@ -518,3 +518,11 @@ void FileRef::parse(IOStream *stream, bool readAudioProperties,
d->file = detectByContent(stream, readAudioProperties, audioPropertiesStyle);
}
FileRef::FileTypeResolver::~FileTypeResolver()
{
}
FileRef::StreamTypeResolver::~StreamTypeResolver()
{
}

View File

@ -91,8 +91,12 @@ namespace TagLib {
class TAGLIB_EXPORT FileTypeResolver
{
TAGLIB_IGNORE_MISSING_DESTRUCTOR
public:
/*!
* Destroys this FileTypeResolver instance.
*/
virtual ~FileTypeResolver() = 0;
/*!
* This method must be overridden to provide an additional file type
* resolver. If the resolver is able to determine the file type it should
@ -110,8 +114,12 @@ namespace TagLib {
class TAGLIB_EXPORT StreamTypeResolver : public FileTypeResolver
{
TAGLIB_IGNORE_MISSING_DESTRUCTOR
public:
/*!
* Destroys this StreamTypeResolver instance.
*/
virtual ~StreamTypeResolver() = 0;
virtual File *createFileFromStream(IOStream *stream,
bool readAudioProperties = true,
AudioProperties::ReadStyle

View File

@ -67,6 +67,10 @@ StringHandler::StringHandler()
{
}
StringHandler::~StringHandler()
{
}
String ID3v1::StringHandler::parse(const ByteVector &data) const
{
return String(data, String::Latin1).stripWhiteSpace();

View File

@ -59,11 +59,11 @@ namespace TagLib {
class TAGLIB_EXPORT StringHandler
{
TAGLIB_IGNORE_MISSING_DESTRUCTOR
public:
// BIC: Add virtual destructor.
StringHandler();
virtual ~StringHandler();
/*!
* Decode a string from \a data. The default implementation assumes that
* \a data is an ISO-8859-1 (Latin1) character array.

View File

@ -32,12 +32,6 @@
#define TAGLIB_MINOR_VERSION 0
#define TAGLIB_PATCH_VERSION 0
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 1)) || defined(__clang__)
#define TAGLIB_IGNORE_MISSING_DESTRUCTOR _Pragma("GCC diagnostic ignored \"-Wnon-virtual-dtor\"")
#else
#define TAGLIB_IGNORE_MISSING_DESTRUCTOR
#endif
#if (defined(_MSC_VER) && _MSC_VER >= 1600)
#define TAGLIB_CONSTRUCT_BITSET(x) static_cast<unsigned long long>(x)
#else