diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2026-06-01 09:55:18 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2026-06-01 09:55:54 -0700 |
| commit | 43f163034682d0139a9986117bce7945ed60c1e9 (patch) | |
| tree | 0dfe870a0f2cc90f937c6b849e6048d3027d0d88 /src/xfaces.c | |
| parent | 7502836378be1610fa6db4541865c06a425491e3 (diff) | |
Improve x_free_gc checking when debugging
* src/xfaces.c (x_free_gc): When debugging,
also diagnose unlikely case when ngcs == INT_MIN.
Diffstat (limited to 'src/xfaces.c')
| -rw-r--r-- | src/xfaces.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index fcec00fbc1f..dafc50f559f 100644 --- a/src/xfaces.c +++ b/src/xfaces.c @@ -539,7 +539,7 @@ static void x_free_gc (struct frame *f, GC gc) { eassert (input_blocked_p ()); - IF_DEBUG ((--ngcs, eassert (ngcs >= 0))); + IF_DEBUG ((eassert (ngcs > 0), ngcs--)); XFreeGC (FRAME_X_DISPLAY (f), gc); } @@ -565,7 +565,7 @@ x_create_gc (struct frame *f, unsigned long mask, Emacs_GC *egc) static void x_free_gc (struct frame *f, Emacs_GC *gc) { - IF_DEBUG ((--ngcs, eassert (ngcs >= 0))); + IF_DEBUG ((eassert (ngcs > 0), ngcs--)); xfree (gc); } |
