From fc3c942d113a28089bffd94ff5addc79f3eef673 Mon Sep 17 00:00:00 2001 From: Neil Date: Sun, 15 Apr 2018 13:46:42 +1000 Subject: Backport: Feature [feature-requests:#1215]. Stop warning about virtual call in destructor. Backport of changeset 6690:2107e0144806. --- cocoa/PlatCocoa.h | 3 +++ cocoa/PlatCocoa.mm | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'cocoa') diff --git a/cocoa/PlatCocoa.h b/cocoa/PlatCocoa.h index 7557fbd35..843128a6c 100644 --- a/cocoa/PlatCocoa.h +++ b/cocoa/PlatCocoa.h @@ -65,6 +65,9 @@ private: static const int BITS_PER_COMPONENT = 8; static const int BITS_PER_PIXEL = BITS_PER_COMPONENT * 4; static const int BYTES_PER_PIXEL = BITS_PER_PIXEL / 8; + + void Clear(); + public: SurfaceImpl(); ~SurfaceImpl() override; diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index ab9d449a0..97fee88d7 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -156,12 +156,12 @@ SurfaceImpl::SurfaceImpl() SurfaceImpl::~SurfaceImpl() { - Release(); + Clear(); } //-------------------------------------------------------------------------------------------------- -void SurfaceImpl::Release() +void SurfaceImpl::Clear() { textLayout->setContext(nullptr); if (bitmapData) @@ -181,6 +181,12 @@ void SurfaceImpl::Release() //-------------------------------------------------------------------------------------------------- +void SurfaceImpl::Release() { + Clear(); +} + +//-------------------------------------------------------------------------------------------------- + bool SurfaceImpl::Initialised() { // We are initalised if the graphics context is not null -- cgit v1.2.3