Skip to content

Commit 5c92c23

Browse files
committed
windows.cfg: SendMessage must not be <leak-ignore/>
1 parent 9082c09 commit 5c92c23

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

cfg/windows.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2161,7 +2161,6 @@ HFONT CreateFont(
21612161
</function>
21622162
<function name="SendMessage,SendMessageA,SendMessageW">
21632163
<noreturn>false</noreturn>
2164-
<leak-ignore/>
21652164
<arg nr="1">
21662165
<not-null/>
21672166
<not-uninit/>

test/testmemleak.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5978,6 +5978,7 @@ class TestMemleakWindows : public TestFixture {
59785978

59795979
TEST_CASE(openfileNoLeak);
59805980
TEST_CASE(returnValueNotUsed_tfopen_s);
5981+
TEST_CASE(sendMessage);
59815982
}
59825983

59835984
void openfileNoLeak() {
@@ -6011,6 +6012,14 @@ class TestMemleakWindows : public TestFixture {
60116012
"}");
60126013
TODO_ASSERT_EQUALS("[test.c:3]: (error) Resource leak: fp\n", "", errout.str());
60136014
}
6015+
6016+
void sendMessage() {
6017+
check("void SetFont() {\n"
6018+
" HFONT hf = CreateFontIndirect(&lf);\n"
6019+
" SendMessage(hwnd, WM_SETFONT, (WPARAM)hf, TRUE);\n" // We do not know what the handler for the message will do with 'hf', so it might be closed later
6020+
"}");
6021+
ASSERT_EQUALS("", errout.str());
6022+
}
60146023
};
60156024

60166025
REGISTER_TEST(TestMemleakWindows)

0 commit comments

Comments
 (0)