diff options
author | Neil <nyamatongwe@gmail.com> | 2018-04-15 13:46:42 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2018-04-15 13:46:42 +1000 |
commit | 699d75f881ad79e98f9400eeb4a7f86a749b1521 (patch) | |
tree | 24af01d6dce086e8f26cde2e57bc705d75387a43 /qt/ScintillaEditBase/PlatQt.cpp | |
parent | 9f2ab7100c117a73d562f81eb590f32f4641cf54 (diff) | |
download | scintilla-mirror-699d75f881ad79e98f9400eeb4a7f86a749b1521.tar.gz |
Feature [feature-requests:#1215]. Stop warning about virtual call in destructor.
Diffstat (limited to 'qt/ScintillaEditBase/PlatQt.cpp')
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index 87496a191..e32fec67d 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -165,7 +165,23 @@ SurfaceImpl::SurfaceImpl() SurfaceImpl::~SurfaceImpl() { - Release(); + Clear(); +} + +void SurfaceImpl::Clear() +{ + if (painterOwned && painter) { + delete painter; + } + + if (deviceOwned && device) { + delete device; + } + + device = 0; + painter = 0; + deviceOwned = false; + painterOwned = false; } void SurfaceImpl::Init(WindowID wid) @@ -197,18 +213,7 @@ void SurfaceImpl::InitPixMap(int width, void SurfaceImpl::Release() { - if (painterOwned && painter) { - delete painter; - } - - if (deviceOwned && device) { - delete device; - } - - device = 0; - painter = 0; - deviceOwned = false; - painterOwned = false; + Clear(); } bool SurfaceImpl::Initialised() |