diff options
Diffstat (limited to 'qt')
-rw-r--r-- | qt/ScintillaEditBase/PlatQt.cpp | 4 | ||||
-rw-r--r-- | qt/ScintillaEditBase/ScintillaQt.cpp | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/qt/ScintillaEditBase/PlatQt.cpp b/qt/ScintillaEditBase/PlatQt.cpp index d49d22f0f..9cbf591b9 100644 --- a/qt/ScintillaEditBase/PlatQt.cpp +++ b/qt/ScintillaEditBase/PlatQt.cpp @@ -611,9 +611,9 @@ QPainter *SurfaceImpl::GetPainter() return painter; } -Surface *Surface::Allocate(int) +std::unique_ptr<Surface> Surface::Allocate(int) { - return new SurfaceImpl; + return std::make_unique<SurfaceImpl>(); } diff --git a/qt/ScintillaEditBase/ScintillaQt.cpp b/qt/ScintillaEditBase/ScintillaQt.cpp index 859396aa2..707862416 100644 --- a/qt/ScintillaEditBase/ScintillaQt.cpp +++ b/qt/ScintillaEditBase/ScintillaQt.cpp @@ -668,12 +668,11 @@ public: void paintEvent(QPaintEvent *) override { if (pct->inCallTipMode) { - Surface *surfaceWindow = Surface::Allocate(0); + std::unique_ptr<Surface> surfaceWindow = Surface::Allocate(0); surfaceWindow->Init(this); surfaceWindow->SetUnicodeMode(SC_CP_UTF8 == pct->codePage); surfaceWindow->SetDBCSMode(pct->codePage); - pct->PaintCT(surfaceWindow); - delete surfaceWindow; + pct->PaintCT(surfaceWindow.get()); } } |