aboutsummaryrefslogtreecommitdiffhomepage
path: root/gtk/PlatGTK.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2017-04-15 16:47:52 +1000
committerNeil <nyamatongwe@gmail.com>2017-04-15 16:47:52 +1000
commitfaf57f45eae60a257a8076c83c71c422486f88ce (patch)
treebae925421b4048bc7de7784e38d73b9960e85553 /gtk/PlatGTK.cxx
parent75dba090f235fc4d24691bd1b57928f89ebe9f1b (diff)
downloadscintilla-mirror-faf57f45eae60a257a8076c83c71c422486f88ce.tar.gz
Avoid calling virtual functions in constructors and destructors.
Diffstat (limited to 'gtk/PlatGTK.cxx')
-rw-r--r--gtk/PlatGTK.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 8a00fcdad..8b0c997da 100644
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -168,6 +168,7 @@ public:
void Init(SurfaceID sid, WindowID wid) override;
void InitPixMap(int width, int height, Surface *surface_, WindowID wid) override;
+ void Clear();
void Release() override;
bool Initialised() override;
void PenColour(ColourDesired fore) override;
@@ -276,10 +277,10 @@ x(0), y(0), inited(false), createdGC(false)
}
SurfaceImpl::~SurfaceImpl() {
- Release();
+ Clear();
}
-void SurfaceImpl::Release() {
+void SurfaceImpl::Clear() {
et = singleByte;
if (createdGC) {
createdGC = false;
@@ -303,6 +304,10 @@ void SurfaceImpl::Release() {
createdGC = false;
}
+void SurfaceImpl::Release() {
+ Clear();
+}
+
bool SurfaceImpl::Initialised() {
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 8, 0)
if (inited && context) {