all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Akihiro KAYAMA <kayama.akihiro@gmail.com>
Cc: 14850-done@debbugs.gnu.org
Subject: bug#14850: 24.3; GDI Handles leak(Windows)
Date: Sun, 14 Jul 2013 19:06:47 +0300	[thread overview]
Message-ID: <83ip0d3z3c.fsf@gnu.org> (raw)
In-Reply-To: <CA+wFm7T1yHwpT=oehBFsF=q_khG=c26WPf8heNYdnajVw8KkYg@mail.gmail.com>

> Date: Sun, 14 Jul 2013 18:55:24 +0900
> From: Akihiro KAYAMA <kayama.akihiro@gmail.com>
> Cc: 14850@debbugs.gnu.org
> 
> I understand you can't reproduce GDI Handles leak. Just to make sure,
> I mention again three requiremetns fot it.
> 
>  - multiple frames
>  - continuous shell buffer output(maybe mode line updates)
>  - mini buffer

Actually, I think I did succeed to reproduce this.  Here's a much
easier method, for the record:

  emacs -Q
  M-x make-frame-command RET
  M-: (require 'time) RET
  M-: (setq display-time-interval 1) RET
  M-: (setq display-time-format "%H:%M:%S") RET
  M-x display-time RET
  C-x C-f

As long as Emacs sits at the minibuffer prompt, you'll have a GDI
handle leaked once every second, according to display-time-interval.
Type C-g to get out of the minibuffer, and the leak stops.

IOW, the conditions for this are:

 . more than 1 frame

 . active minibuffer prompt, and

 . continuous redisplay

According to my measurements, the change I made in revision 113415
completely stops GDI handle leak in this scenario, and also in your
original one.  So I will close this bug; feel free to reopen if you
can still come up with a scenario where GDI objects are leaked.

The changes I committed are below, for your convenience.

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2013-07-13 10:29:15 +0000
+++ src/ChangeLog	2013-07-13 14:21:01 +0000
@@ -1,5 +1,8 @@
 2013-07-13  Eli Zaretskii  <eliz@gnu.org>
 
+	* w32term.c (x_draw_hollow_cursor): Delete the brush object when
+	returning early.  (Bug#14850)
+
 	* coding.c (syms_of_coding): Set up inhibit-null-byte-detection
 	and inhibit-iso-escape-detection attributes of 'undecided'.
 	(Bug#14822)

=== modified file 'src/w32term.c'
--- src/w32term.c	2013-07-06 02:40:50 +0000
+++ src/w32term.c	2013-07-13 14:21:01 +0000
@@ -5174,7 +5174,10 @@ x_draw_hollow_cursor (struct window *w, 
      the current matrix is invalid or such, give up.  */
   cursor_glyph = get_phys_cursor_glyph (w);
   if (cursor_glyph == NULL)
-    return;
+    {
+      DeleteObject (hb);
+      return;
+    }
 
   /* Compute frame-relative coordinates for phys cursor.  */
   get_phys_cursor_geometry (w, row, cursor_glyph, &left, &top, &h);






      reply	other threads:[~2013-07-14 16:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-12  9:49 bug#14850: 24.3; GDI Handles leak(Windows) Akihiro KAYAMA
2013-07-13 12:55 ` Eli Zaretskii
2013-07-13 14:22   ` Eli Zaretskii
2013-07-14  9:55     ` Akihiro KAYAMA
2013-07-14 16:06       ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83ip0d3z3c.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=14850-done@debbugs.gnu.org \
    --cc=kayama.akihiro@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.