GNU bug report logs -
#3468
Support drag and drop of text on MS Windows
Previous Next
Full log
Message #48 received at 3468 <at> debbugs.gnu.org (full text, mbox):
> Date: Sat, 5 Oct 2024 14:07:01 +0200
> Cc: 3468 <at> debbugs.gnu.org
> From: Cecilio Pardo <cpardo <at> imayhem.com>
>
> On 05/10/2024 13:07, Eli Zaretskii wrote:
>
> >> There is no malloc/strdup.
> >
> > Well, there are still 2 calls to malloc in w32_createwindow. Any
> > reasons not to call xmalloc instead? Can w32_createwindow be called
> > before we call init_heap?
>
> [...]
>
> > Do we ever have to free the two memory chunks we allocate here? Like
> > when the window is disposed of?
>
> They are freed in w32_drop_target_Release, which is called internally
> when we call RevokeDragDrop while handling the WW_EMACS_DESTROYWINDOW on
> w32_wnd_proc.
>
> As this runs on the input thread, I used malloc/free instead of
> xmalloc/xfree. I could send a message to handle on w32_read_socket and
> then use xmalloc.
It's okay to use malloc/free in this case, but we must check the
return value of malloc to not be NULL.
> > This function should call block_input at entry and unblock_input
> > before it exits, because we must make sure all the GlobalLock calls
> > are paired with GlobalUnlock and GlobalFree, while functions we call
> > here, process_dropfiles etc., all cons Lisp object, and therefore
> > could potentially QUIT, which throws to top-level.
>
> The function (w32_process_dnd_data) is called from within the
> block_input/unblock_input on w32_read_socket.
Ah, okay.
> Should I add its own calls for clarity? Maybe just a comment?
Yes, please.
This bug report was last modified 266 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.