diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2010-02-04 23:44:01 +0100 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2010-02-04 23:44:01 +0100 |
commit | c1e2186b6a3b14e4da3232c2c9d2a03c1fb9a1a2 (patch) | |
tree | 0029df657ccdc37ff2f190ec2e5ed38528e47631 /dxr3device.h | |
parent | bb0ff923fa2636b9287e04e7215fd3907d34e969 (diff) | |
download | vdr-plugin-dxr3-c1e2186b6a3b14e4da3232c2c9d2a03c1fb9a1a2.tar.gz vdr-plugin-dxr3-c1e2186b6a3b14e4da3232c2c9d2a03c1fb9a1a2.tar.bz2 |
fix crash at shutdown
We can not inherit from Singleton<cDxr3Device> as the vdr core does
free the created instance. So if we use the auto_ptr based Singleton
template class we get a double free.
Diffstat (limited to 'dxr3device.h')
-rw-r--r-- | dxr3device.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/dxr3device.h b/dxr3device.h index 02cfae0..f6eefdb 100644 --- a/dxr3device.h +++ b/dxr3device.h @@ -30,7 +30,7 @@ #include "dxr3audiodecoder.h" #include "dxr3spudecoder.h" #include "dxr3audio.h" -#include "singleton.h" +#include "uncopyable.h" class cDxr3Name { public: @@ -47,10 +47,9 @@ private: cDxr3Device is the interface for VDR devices. Is is the part, which VDR "talks" with our plugin. */ -class cDxr3Device : public cDevice, public Singleton<cDxr3Device> { +class cDxr3Device : public cDevice, public Uncopyable { public: - cDxr3Device(); - ~cDxr3Device(); + static cDxr3Device *instance(); static int Dxr3Open(const char *name, int mode, bool report_error = true); virtual void MakePrimaryDevice(bool On); @@ -97,6 +96,8 @@ public: int ossSetPlayMode(uint32_t mode); private: + cDxr3Device(); + ~cDxr3Device(); void claimDevices(); void releaseDevices(); @@ -122,6 +123,8 @@ private: uint32_t horizontal; uint32_t vertical; + + static cDxr3Device *inst; }; #endif /*_DXR3_DEVICE_H_*/ |