aboutsummaryrefslogtreecommitdiff
path: root/baselibs
diff options
context:
space:
mode:
authorPacketVideo CM <engbuild@pv.com>2009-12-04 11:48:44 -0800
committerPacketVideo CM <engbuild@pv.com>2009-12-04 11:48:44 -0800
commit307eeb2e44086b47aa56514038d5fd11be0df1ee (patch)
treef68754b39211b639e1e28e4cc66caf43ca84f666 /baselibs
parent699e7821bf4e5c9a816d83e71d3f2fec77e2ce90 (diff)
downloadopencore-307eeb2e44086b47aa56514038d5fd11be0df1ee.tar.gz
RIO-6966: Classes with virtual methods should have virtual destructors too
Diffstat (limited to 'baselibs')
-rw-r--r--baselibs/thread_messaging/src/pv_interface_proxy.cpp12
-rw-r--r--baselibs/thread_messaging/src/pv_proxied_interface.h2
-rw-r--r--baselibs/threadsafe_callback_ao/src/threadsafe_queue.h1
3 files changed, 14 insertions, 1 deletions
diff --git a/baselibs/thread_messaging/src/pv_interface_proxy.cpp b/baselibs/thread_messaging/src/pv_interface_proxy.cpp
index c77a2eccc..bc66ec02f 100644
--- a/baselibs/thread_messaging/src/pv_interface_proxy.cpp
+++ b/baselibs/thread_messaging/src/pv_interface_proxy.cpp
@@ -132,8 +132,18 @@ OSCL_EXPORT_REF void CPVInterfaceProxy::ConstructL(uint32 nreserve1, uint32 nres
OSCL_EXPORT_REF void CPVInterfaceProxy::Delete()
//called under app thread context
{
+ Oscl_DefAlloc *alloc = this->iAlloc;
+ bool default_alloc = (this->iAlloc == &this->iDefAlloc);
this->~CPVInterfaceProxy();
- iAlloc->deallocate(this);
+ if (default_alloc)
+ {
+ OsclMemAllocator defalloc;
+ defalloc.deallocate(this);
+ }
+ else
+ {
+ alloc->deallocate(this);
+ }
}
OSCL_EXPORT_REF CPVInterfaceProxy::~CPVInterfaceProxy()
diff --git a/baselibs/thread_messaging/src/pv_proxied_interface.h b/baselibs/thread_messaging/src/pv_proxied_interface.h
index 76f86a951..4629811fc 100644
--- a/baselibs/thread_messaging/src/pv_proxied_interface.h
+++ b/baselibs/thread_messaging/src/pv_proxied_interface.h
@@ -274,6 +274,7 @@ class PVProxiedInterface : public PVInterface
class PVProxiedInterfaceServer
{
public:
+ virtual ~PVProxiedInterfaceServer() {};
/**
** PVMainProxy calls this under the PV thread to process a
** command off the queue.
@@ -303,6 +304,7 @@ class PVProxiedInterfaceClient
{
public:
PVProxiedInterfaceClient() {}
+ virtual ~PVProxiedInterfaceClient() {};
/**
** PVMainProxy calls this to process a notification off the
diff --git a/baselibs/threadsafe_callback_ao/src/threadsafe_queue.h b/baselibs/threadsafe_callback_ao/src/threadsafe_queue.h
index f988d31a1..01ce70f69 100644
--- a/baselibs/threadsafe_callback_ao/src/threadsafe_queue.h
+++ b/baselibs/threadsafe_callback_ao/src/threadsafe_queue.h
@@ -46,6 +46,7 @@ class ThreadSafeQueue;
class ThreadSafeQueueObserver
{
public:
+ virtual ~ThreadSafeQueueObserver() {};
/*
** Observer receives this callback when data has been added to the queue.
** There may be multiple data available when this is called. There will