From: Konstantin Ritt Date: Sat, 11 Apr 2015 15:33:20 +0000 (+0400) Subject: [DirectShow] Fix potention undefined behavior on destruction X-Git-Tag: v5.5.90+alpha1~27^2~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=740f16ac602b43ee61d6d1a22ad366dbf1d72e9a;p=platform%2Fupstream%2Fqtmultimedia.git [DirectShow] Fix potention undefined behavior on destruction The exact warning is: > deleting object of polymorphic class type which has non-virtual destructor might cause undefined behavior Change-Id: I8f259def3f1f7f776fb31ace9dfcc7145426f5c0 Reviewed-by: Yoann Lopes --- diff --git a/src/plugins/directshow/player/directshowiosource.h b/src/plugins/directshow/player/directshowiosource.h index fb3774a..e45c852 100644 --- a/src/plugins/directshow/player/directshowiosource.h +++ b/src/plugins/directshow/player/directshowiosource.h @@ -49,7 +49,7 @@ class DirectShowIOSource { public: DirectShowIOSource(DirectShowEventLoop *loop); - ~DirectShowIOSource(); + virtual ~DirectShowIOSource(); void setDevice(QIODevice *device); void setAllocator(IMemAllocator *allocator); diff --git a/src/plugins/directshow/player/directshowmediatypelist.cpp b/src/plugins/directshow/player/directshowmediatypelist.cpp index c50f31e..7adf98c 100644 --- a/src/plugins/directshow/player/directshowmediatypelist.cpp +++ b/src/plugins/directshow/player/directshowmediatypelist.cpp @@ -41,7 +41,7 @@ class DirectShowMediaTypeEnum : public IEnumMediaTypes { public: DirectShowMediaTypeEnum(DirectShowMediaTypeList *list, int token, int index = 0); - ~DirectShowMediaTypeEnum(); + virtual ~DirectShowMediaTypeEnum(); // IUnknown HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject); @@ -143,6 +143,10 @@ DirectShowMediaTypeList::DirectShowMediaTypeList() { } +DirectShowMediaTypeList::~DirectShowMediaTypeList() +{ +} + IEnumMediaTypes *DirectShowMediaTypeList::createMediaTypeEnum() { return new DirectShowMediaTypeEnum(this, m_mediaTypeToken, 0); diff --git a/src/plugins/directshow/player/directshowmediatypelist.h b/src/plugins/directshow/player/directshowmediatypelist.h index c06363d..008293a 100644 --- a/src/plugins/directshow/player/directshowmediatypelist.h +++ b/src/plugins/directshow/player/directshowmediatypelist.h @@ -42,6 +42,7 @@ class DirectShowMediaTypeList : public IUnknown { public: DirectShowMediaTypeList(); + virtual ~DirectShowMediaTypeList(); IEnumMediaTypes *createMediaTypeEnum(); diff --git a/src/plugins/directshow/player/directshowpinenum.h b/src/plugins/directshow/player/directshowpinenum.h index 47b4e1a..3cc62e2 100644 --- a/src/plugins/directshow/player/directshowpinenum.h +++ b/src/plugins/directshow/player/directshowpinenum.h @@ -42,7 +42,7 @@ class DirectShowPinEnum : public IEnumPins { public: DirectShowPinEnum(const QList &pins); - ~DirectShowPinEnum(); + virtual ~DirectShowPinEnum(); // IUnknown HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppvObject);