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 | fc3c942d113a28089bffd94ff5addc79f3eef673 (patch) | |
tree | c63ca598bdc4d3f534bf860b36527c1691345476 /qt/ScintillaEditBase/PlatQt.cpp | |
parent | ba3dd815ce5596260f500d85728d943274beb2ed (diff) | |
download | scintilla-mirror-fc3c942d113a28089bffd94ff5addc79f3eef673.tar.gz |
Backport: Feature [feature-requests:#1215]. Stop warning about virtual call in destructor.
Backport of changeset 6690:2107e0144806.
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() |