On 07/07/06, Robert Shearman <[EMAIL PROTECTED]> wrote:
However, I did find two things that I think need consideration or
improvement:

 From 01_server_cursoricon.diff.txt:

> +/* Destroy a cursor */
> +DECL_HANDLER(destroy_cursor)
> +{
> +    unsigned int i;
> +    cursor_t *cursor = free_user_handle( req->handle );
> +
> +    if (!cursor) return;
> +
> +    for (i = 0; i < cursor->num_frames; ++i)
> +    {
> +        if (cursor->frames[i].bits) free( cursor->frames[i].bits );
> +    }
> +
> +    free( cursor->frames );
> +}


This appears to be the only place where a cursor is destroyed. Thus, a
bad application could end up wineserver to leak memory. I think you need
to investigate when Windows frees cursors that have not had
DestroyCursor called on them. My guess is that it frees them on process
destruction.


 From 09_user_ani_cursor.diff.txt:

> --- a/dlls/user/Makefile.in
> +++ b/dlls/user/Makefile.in
> @@ -6,7 +6,7 @@ VPATH     = @srcdir@
>  MODULE    = user32.dll
>  IMPORTLIB = libuser32.$(IMPLIBEXT)
>  IMPORTS   = gdi32 advapi32 kernel32 ntdll
> -DELAYIMPORTS = imm32
> +DELAYIMPORTS = imm32 winmm
>  EXTRALIBS = $(LIBUNICODE)
>
>  SPEC_SRCS16 = \


I'm not sure it is acceptable to import winmm from user32, even if it is
a delay import.

--
Rob Shearman


Attached is a slightly updated version of the patchset. I got rid of
the winmm import, and it should now destroy cursors / icons when the
process is destroyed. The changes are in parts 1 & 9, the rest should
be pretty much unchanged.

Attachment: cursor_patches_20060721.tar.bz2
Description: BZip2 compressed data



Reply via email to