From 081a48ebabc5c258aa580ff05d31f29c3fb3e08d Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Mon, 26 Nov 2018 13:14:01 +0100 Subject: [PATCH] server: Release atoms when destroying a window class. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46180 Signed-off-by: Ralf Habacker Signed-off-by: Alexandre Julliard --- dlls/user32/tests/class.c | 4 ++++ server/class.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/dlls/user32/tests/class.c b/dlls/user32/tests/class.c index d6910d982d9..2702fa00b93 100644 --- a/dlls/user32/tests/class.c +++ b/dlls/user32/tests/class.c @@ -115,6 +115,8 @@ static void ClassTest(HINSTANCE hInstance, BOOL global) return; ok(classatom, "failed to register class\n"); + ok(GetClipboardFormatNameW(classatom, str, ARRAY_SIZE(str)) != 0, "atom not found\n"); + ok(!RegisterClassW (&cls), "RegisterClass of the same class should fail for the second time\n"); @@ -230,6 +232,8 @@ static void ClassTest(HINSTANCE hInstance, BOOL global) ok(UnregisterClassW(className, hInstance), "UnregisterClass() failed\n"); + ok(GetClipboardFormatNameW(classatom, str, ARRAY_SIZE(str)) == 0, + "atom still found\n"); return; } diff --git a/server/class.c b/server/class.c index 403180db79f..b8240bd5688 100644 --- a/server/class.c +++ b/server/class.c @@ -76,6 +76,8 @@ static struct window_class *create_class( struct process *process, int extra_byt static void destroy_class( struct window_class *class ) { + release_global_atom( NULL, class->atom ); + release_global_atom( NULL, class->base_atom ); list_remove( &class->entry ); release_object( class->process ); free( class );