From eee033eb7e973d8a335c34bb9e72372ccad616d2 Mon Sep 17 00:00:00 2001 From: ronag Date: Fri, 29 Oct 2010 17:25:39 +0000 Subject: [PATCH] 2.0.0.2: - Added missing virtual destructors git-svn-id: https://casparcg.svn.sourceforge.net/svnroot/casparcg/server/branches/2.0.0.2@186 362d55ac-95cf-4e76-9f9a-cbaa9c17b72d --- common/utility/memory.cpp | 4 ---- core/consumer/frame_consumer.h | 3 +-- core/frame/composite_gpu_frame.cpp | 2 +- core/frame/composite_gpu_frame.h | 6 +++--- core/frame/frame_factory.h | 1 + core/frame/gpu_frame.cpp | 2 +- core/frame/gpu_frame.h | 6 ++++-- core/frame/gpu_frame_processor.cpp | 4 ++-- core/renderer/layer.cpp | 6 ++++-- test/test.vcxproj | 1 + 10 files changed, 18 insertions(+), 17 deletions(-) diff --git a/common/utility/memory.cpp b/common/utility/memory.cpp index c33dbeff1..0be280d31 100644 --- a/common/utility/memory.cpp +++ b/common/utility/memory.cpp @@ -11,10 +11,6 @@ namespace caspar { namespace common { void* memcpy_SSE2(void* dest, const void* source, size_t num) { - assert(dest != nullptr); - assert(source != nullptr); - assert(dest != source); - assert(num % 256 == 0); __asm { mov esi, source; diff --git a/core/consumer/frame_consumer.h b/core/consumer/frame_consumer.h index bbc661f4b..3eb7bc6ac 100644 --- a/core/consumer/frame_consumer.h +++ b/core/consumer/frame_consumer.h @@ -27,9 +27,8 @@ namespace caspar { -class frame_consumer : boost::noncopyable +struct frame_consumer : boost::noncopyable { -public: virtual ~frame_consumer() {} virtual const frame_format_desc& get_frame_format_desc() const = 0; diff --git a/core/frame/composite_gpu_frame.cpp b/core/frame/composite_gpu_frame.cpp index 6ee65509d..4eac38eaa 100644 --- a/core/frame/composite_gpu_frame.cpp +++ b/core/frame/composite_gpu_frame.cpp @@ -9,7 +9,7 @@ namespace caspar { -struct composite_gpu_frame::implementation +struct composite_gpu_frame::implementation : boost::noncopyable { implementation(composite_gpu_frame* self) : self_(self){} diff --git a/core/frame/composite_gpu_frame.h b/core/frame/composite_gpu_frame.h index ebe585b21..821ed5cce 100644 --- a/core/frame/composite_gpu_frame.h +++ b/core/frame/composite_gpu_frame.h @@ -20,10 +20,10 @@ public: void draw(); void reset(); - unsigned char* data(); + virtual unsigned char* data(); - const std::vector& audio_data() const; - std::vector& audio_data(); + virtual const std::vector& audio_data() const; + virtual std::vector& audio_data(); void add(const gpu_frame_ptr& frame); diff --git a/core/frame/frame_factory.h b/core/frame/frame_factory.h index 3c571f777..47a7c7886 100644 --- a/core/frame/frame_factory.h +++ b/core/frame/frame_factory.h @@ -9,6 +9,7 @@ namespace caspar { struct frame_factory { + virtual ~frame_factory(){} virtual gpu_frame_ptr create_frame(size_t width, size_t height) = 0; gpu_frame_ptr create_frame(const frame_format_desc format_desc) { diff --git a/core/frame/gpu_frame.cpp b/core/frame/gpu_frame.cpp index b737cad54..1b88953a4 100644 --- a/core/frame/gpu_frame.cpp +++ b/core/frame/gpu_frame.cpp @@ -61,7 +61,7 @@ GLubyte lower_pattern[] = { 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff}; -struct gpu_frame::implementation +struct gpu_frame::implementation : boost::noncopyable { implementation(size_t width, size_t height) : pbo_(0), data_(nullptr), width_(width), height_(height), size_(width*height*4), diff --git a/core/frame/gpu_frame.h b/core/frame/gpu_frame.h index 9ac7de3b6..641dbee54 100644 --- a/core/frame/gpu_frame.h +++ b/core/frame/gpu_frame.h @@ -4,15 +4,17 @@ #include +#include + #include namespace caspar { -class gpu_frame +class gpu_frame : boost::noncopyable { public: gpu_frame(size_t width, size_t height); - + virtual ~gpu_frame(){} virtual void write_lock(); virtual bool write_unlock(); virtual void read_lock(GLenum mode); diff --git a/core/frame/gpu_frame_processor.cpp b/core/frame/gpu_frame_processor.cpp index ced2ca20e..b9e1e4b2d 100644 --- a/core/frame/gpu_frame_processor.cpp +++ b/core/frame/gpu_frame_processor.cpp @@ -31,7 +31,7 @@ namespace caspar { -class frame_buffer +class frame_buffer : boost::noncopyable { public: frame_buffer(size_t width, size_t height) @@ -68,7 +68,7 @@ private: }; typedef std::shared_ptr frame_buffer_ptr; -struct gpu_frame_processor::implementation +struct gpu_frame_processor::implementation : boost::noncopyable { implementation(const frame_format_desc& format_desc) : format_desc_(format_desc) { diff --git a/core/renderer/layer.cpp b/core/renderer/layer.cpp index 536144760..d3e1114ec 100644 --- a/core/renderer/layer.cpp +++ b/core/renderer/layer.cpp @@ -8,9 +8,9 @@ namespace caspar { namespace renderer { -struct layer::implementation +struct layer::implementation : boost::noncopyable { - implementation() : preview_frame_(nullptr), active_(nullptr), background_(nullptr) {} + implementation() : preview_frame_(nullptr), active_(nullptr), background_(nullptr), last_frame_(nullptr) {} void load(const frame_producer_ptr& frame_producer, load_option option) { @@ -62,6 +62,7 @@ struct layer::implementation { active_ = nullptr; background_ = nullptr; + last_frame_ = nullptr; } gpu_frame_ptr get_frame() @@ -77,6 +78,7 @@ struct layer::implementation { CASPAR_LOG_CURRENT_EXCEPTION(); active_ = nullptr; + last_frame_ = nullptr; CASPAR_LOG(warning) << "Removed producer from layer."; } diff --git a/test/test.vcxproj b/test/test.vcxproj index 1b852ea1b..2597da67c 100644 --- a/test/test.vcxproj +++ b/test/test.vcxproj @@ -84,6 +84,7 @@ NotUsing + true -- 2.39.2