diff options
author | nyamatongwe <devnull@localhost> | 2013-05-01 16:25:32 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2013-05-01 16:25:32 +1000 |
commit | c43e2b6ff04039bf1564d56ae5065127fa52ee25 (patch) | |
tree | b75232953441f39256cfe29ec61682ea82adf254 | |
parent | 6744d7c705dff026bd80c193c5a18dcbb92f3508 (diff) | |
download | scintilla-mirror-c43e2b6ff04039bf1564d56ae5065127fa52ee25.tar.gz |
Replacing raw pointer and allocation with std::vector.
-rw-r--r-- | win32/ScintillaWin.cxx | 6 |
1 files 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<char> bits(bitmapSize); sysCaretBitmap = ::CreateBitmap(sysCaretWidth, sysCaretHeight, 1, - 1, reinterpret_cast<BYTE *>(bits)); - delete []bits; + 1, reinterpret_cast<BYTE *>(bits.data())); BOOL retval = ::CreateCaret( MainHWND(), sysCaretBitmap, sysCaretWidth, sysCaretHeight); |