mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-04 20:37:39 +00:00
server: Remove obsolete synthesized formats in release_clipboard().
Synthesized formats must be removed too if the format they depend on has been removed. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51496 Signed-off-by: Francois Gouget <fgouget@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ce98c3b58e
commit
a716b13974
|
@ -973,7 +973,7 @@ static void test_synthesized(void)
|
||||||
|
|
||||||
/* CF_UNICODETEXT and derivatives, CF_TEXT + CF_OEMTEXT, should be gone */
|
/* CF_UNICODETEXT and derivatives, CF_TEXT + CF_OEMTEXT, should be gone */
|
||||||
count = CountClipboardFormats();
|
count = CountClipboardFormats();
|
||||||
todo_wine ok(count == 1, "count %u\n", count );
|
ok(count == 1, "count %u\n", count );
|
||||||
cf = EnumClipboardFormats( 0 );
|
cf = EnumClipboardFormats( 0 );
|
||||||
ok(cf == CF_LOCALE, "unexpected clipboard format %u\n", cf);
|
ok(cf == CF_LOCALE, "unexpected clipboard format %u\n", cf);
|
||||||
|
|
||||||
|
@ -984,10 +984,9 @@ static void test_synthesized(void)
|
||||||
ok(r, "gle %d\n", GetLastError());
|
ok(r, "gle %d\n", GetLastError());
|
||||||
|
|
||||||
SetLastError(0xdeadbeef);
|
SetLastError(0xdeadbeef);
|
||||||
data = (void*)1; if (broken(1)) /* FIXME Crashes in Wine */
|
|
||||||
data = GetClipboardData( CF_TEXT );
|
data = GetClipboardData( CF_TEXT );
|
||||||
ok(GetLastError() == 0xdeadbeef, "unexpected last error %d\n", GetLastError());
|
ok(GetLastError() == 0xdeadbeef, "bad last error %d\n", GetLastError());
|
||||||
todo_wine ok(!data, "GetClipboardData() should have returned NULL\n");
|
ok(!data, "GetClipboardData() should have returned NULL\n");
|
||||||
|
|
||||||
r = CloseClipboard();
|
r = CloseClipboard();
|
||||||
ok(r, "gle %d\n", GetLastError());
|
ok(r, "gle %d\n", GetLastError());
|
||||||
|
|
|
@ -303,7 +303,11 @@ static user_handle_t release_clipboard( struct clipboard *clipboard )
|
||||||
/* free the delayed-rendered formats, since we no longer have an owner to render them */
|
/* free the delayed-rendered formats, since we no longer have an owner to render them */
|
||||||
LIST_FOR_EACH_ENTRY_SAFE( format, next, &clipboard->formats, struct clip_format, entry )
|
LIST_FOR_EACH_ENTRY_SAFE( format, next, &clipboard->formats, struct clip_format, entry )
|
||||||
{
|
{
|
||||||
if (format->data || format->from) continue;
|
if (format->data) continue;
|
||||||
|
/* format->from is earlier in the list and thus has already been
|
||||||
|
* removed if not available anymore (it is also < CF_MAX)
|
||||||
|
*/
|
||||||
|
if (format->from && HAS_FORMAT( clipboard->format_map, format->from )) continue;
|
||||||
list_remove( &format->entry );
|
list_remove( &format->entry );
|
||||||
if (format->id < CF_MAX) clipboard->format_map &= ~(1 << format->id);
|
if (format->id < CF_MAX) clipboard->format_map &= ~(1 << format->id);
|
||||||
clipboard->format_count--;
|
clipboard->format_count--;
|
||||||
|
|
Loading…
Reference in a new issue