Skip to content

Commit ee0f267

Browse files
committed
- fix issue in callback handling for hwndFrom
#127 SCINTILLANOTIFICATION.CHARADDED: arg key ch is always 0 and #121 Consider using hwndFrom within scintilla notification - fix memory leak issue
1 parent 9151d2e commit ee0f267

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

PythonScript/src/HelpController.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ std::wstring HelpController::getTopicUrl()
139139
url.append(buffer + dotPosition + 1);
140140
}
141141
}
142-
142+
143+
delete[] buffer;
144+
143145
return WcharMbcsConverter::char2tchar(url.c_str()).get();
144146
}

PythonScript/src/ScintillaWrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ void ScintillaWrapper::notify(SCNotification *notifyCode)
8989

9090
// Create the parameters for the callback
9191
params["code"] = notifyCode->nmhdr.code;
92+
params["idFrom"] = notifyCode->nmhdr.idFrom;
93+
params["hwndFrom"] = reinterpret_cast<intptr_t>(notifyCode->nmhdr.hwndFrom);
9294

9395

9496
switch(notifyCode->nmhdr.code)
@@ -236,8 +238,6 @@ void ScintillaWrapper::notify(SCNotification *notifyCode)
236238

237239
default:
238240
// Unknown notification, so just fill in all the parameters.
239-
params["idFrom"] = notifyCode->nmhdr.idFrom;
240-
params["hwndFrom"] = notifyCode->nmhdr.hwndFrom;
241241
params["position"] = notifyCode->position;
242242
params["modificationType"] = notifyCode->modificationType;
243243
if (notifyCode->text)

0 commit comments

Comments
 (0)