[dasher: 197/217] Win32 Load did not close file handle. + cleanup
- From: Patrick Welche <pwelche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dasher: 197/217] Win32 Load did not close file handle. + cleanup
- Date: Sat, 27 Feb 2016 12:16:53 +0000 (UTC)
commit 6478622ddd1a20a5cd8fd01cac89737b2e63fbec
Author: Ada Majorek <amajorek google com>
Date: Sun Jan 31 15:10:02 2016 -0800
Win32 Load did not close file handle. + cleanup
fixes https://github.com/ipomoena/dasher/issues/83
Src/Win32/Widgets/Edit.cpp | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/Src/Win32/Widgets/Edit.cpp b/Src/Win32/Widgets/Edit.cpp
index 4c565e0..d080fa9 100644
--- a/Src/Win32/Widgets/Edit.cpp
+++ b/Src/Win32/Widgets/Edit.cpp
@@ -193,6 +193,7 @@ bool CEdit::TOpen(const Tstring &filename) {
CStringA filestr;
char* filebuffer = filestr.GetBufferSetLength(filesize+2);
ReadFile(FileHandle, filebuffer, filesize, &amountread, NULL);
+ CloseHandle(FileHandle);
filebuffer[amountread] = 0;
filebuffer[amountread+1] = 0;
long encoding = m_pAppSettings->GetLongParameter(APP_LP_FILE_ENCODING);
@@ -300,7 +301,6 @@ void CEdit::output(const std::string &sText) {
if(m_pAppSettings->GetLongParameter(APP_LP_STYLE) == APP_STYLE_DIRECT) {
const char *DisplayText = sText.c_str();
-#ifdef UNICODE
if(DisplayText[0] == 0xd && DisplayText[1] == 0xa) {
// Newline, so we want to fake an enter
fakekey[0].type = fakekey[1].type = INPUT_KEYBOARD;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]