From 71b9f607c9caa065ac500c91526004d6d23969e5 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 1 May 2013 16:25:32 +1000 Subject: Replacing raw pointer and allocation with std::vector. --- win32/ScintillaWin.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index e300253de..67205e9a2 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -2763,11 +2763,9 @@ BOOL ScintillaWin::CreateSystemCaret() { sysCaretHeight = vs.lineHeight; int bitmapSize = (((sysCaretWidth + 15) & ~15) >> 3) * sysCaretHeight; - char *bits = new char[bitmapSize]; - memset(bits, 0, bitmapSize); + std::vector bits(bitmapSize); sysCaretBitmap = ::CreateBitmap(sysCaretWidth, sysCaretHeight, 1, - 1, reinterpret_cast(bits)); - delete []bits; + 1, reinterpret_cast(bits.data())); BOOL retval = ::CreateCaret( MainHWND(), sysCaretBitmap, sysCaretWidth, sysCaretHeight); -- cgit v1.2.3