diff options
| author | Po Lu | 2024-06-29 20:02:45 +0800 |
|---|---|---|
| committer | Po Lu | 2024-06-29 20:02:54 +0800 |
| commit | 2d8881d5267febd0bc4117c2b7e5ee6c33ef436e (patch) | |
| tree | 8053fa9643d72207e624102d8f8198ad4fb25688 /src | |
| parent | 219501dd629811e73d884300534f56647596fb6f (diff) | |
| download | emacs-2d8881d5267febd0bc4117c2b7e5ee6c33ef436e.tar.gz emacs-2d8881d5267febd0bc4117c2b7e5ee6c33ef436e.zip | |
Fix typo incurring leaks of face structures
* src/xfaces.c (free_realized_face): Always free realized face
structures, and avoid sending X requests when the display is not
available, not when it is.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfaces.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/xfaces.c b/src/xfaces.c index 1e0196a1171..188dd4778bc 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -4599,8 +4599,8 @@ free_realized_face (struct frame *f, struct face *face) | |||
| 4599 | /* This function might be called with the frame's display | 4599 | /* This function might be called with the frame's display |
| 4600 | connection deleted, in which event the callbacks below | 4600 | connection deleted, in which event the callbacks below |
| 4601 | should not be executed, as they generate X requests. */ | 4601 | should not be executed, as they generate X requests. */ |
| 4602 | if (FRAME_X_DISPLAY (f)) | 4602 | if (!FRAME_X_DISPLAY (f)) |
| 4603 | return; | 4603 | goto free_face; |
| 4604 | #endif /* HAVE_X_WINDOWS */ | 4604 | #endif /* HAVE_X_WINDOWS */ |
| 4605 | 4605 | ||
| 4606 | if (face->gc) | 4606 | if (face->gc) |
| @@ -4619,6 +4619,9 @@ free_realized_face (struct frame *f, struct face *face) | |||
| 4619 | } | 4619 | } |
| 4620 | #endif /* HAVE_WINDOW_SYSTEM */ | 4620 | #endif /* HAVE_WINDOW_SYSTEM */ |
| 4621 | 4621 | ||
| 4622 | #ifdef HAVE_X_WINDOWS | ||
| 4623 | free_face: | ||
| 4624 | #endif /* HAVE_X_WINDOWS */ | ||
| 4622 | xfree (face); | 4625 | xfree (face); |
| 4623 | } | 4626 | } |
| 4624 | } | 4627 | } |