summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorschmirl <schmirl>2007-07-20 06:46:47 +0000
committerschmirl <schmirl>2007-07-20 06:46:47 +0000
commite9bd0c96f33ee4693bde5d93bb0168c9085802ec (patch)
tree501f7600d9cddb7b32ec40528f42eec8a3bafd63 /client
parent60b44caf3d419fa6794d6f08c49354b96a516c4b (diff)
downloadvdr-plugin-streamdev-e9bd0c96f33ee4693bde5d93bb0168c9085802ec.tar.gz
vdr-plugin-streamdev-e9bd0c96f33ee4693bde5d93bb0168c9085802ec.tar.bz2
Lock in ~cStreamdevDevice when shutting down (#355).
Thanks to Petri Hintukainen.
Diffstat (limited to 'client')
-rw-r--r--client/device.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/client/device.c b/client/device.c
index be79bb9..7069c62 100644
--- a/client/device.c
+++ b/client/device.c
@@ -1,5 +1,5 @@
/*
- * $Id: device.c,v 1.13 2007/05/07 12:18:18 schmirl Exp $
+ * $Id: device.c,v 1.14 2007/07/20 06:46:47 schmirl Exp $
*/
#include "client/device.h"
@@ -51,12 +51,21 @@ cStreamdevDevice::cStreamdevDevice(void) {
cStreamdevDevice::~cStreamdevDevice() {
Dprintf("Device gets destructed\n");
+
+ Lock();
m_Device = NULL;
- delete m_TSBuffer;
- delete m_Assembler;
+ m_Filters->SetConnection(-1);
+ ClientSocket.Quit();
+ ClientSocket.Reset();
+ Unlock();
+
+ Cancel(3);
+
#if VDRVERSNUM >= 10300
- delete m_Filters;
+ DELETENULL(m_Filters);
#endif
+ DELETENULL(m_TSBuffer);
+ delete m_Assembler;
}
bool cStreamdevDevice::ProvidesSource(int Source) const {
@@ -216,7 +225,7 @@ void cStreamdevDevice::CloseDvr(void) {
}
bool cStreamdevDevice::GetTSPacket(uchar *&Data) {
- if (m_TSBuffer) {
+ if (m_TSBuffer && m_Device) {
Data = m_TSBuffer->Get();
#if 1 // TODO: this should be fixed in vdr cTSBuffer
// simple disconnect detection