fix(all): Fix two segfault bugs in map.lic#2232
Closed
MahtraDR wants to merge 3 commits intoelanthia-online:masterfrom
Closed
fix(all): Fix two segfault bugs in map.lic#2232MahtraDR wants to merge 3 commits intoelanthia-online:masterfrom
MahtraDR wants to merge 3 commits intoelanthia-online:masterfrom
Conversation
…segfault 1. Borderless toggle: split compound expression `window.set_decorated(!setting_borderless = owner.active?)` into two statements. The compound form passes a complex Ruby expression through gobject-introspection's invoke, which crashes on some platforms. 2. before_dying cleanup: hide image and circle_image widgets before destroying the window. On macOS with GTK3/Quartz backend, destroying the window while Cairo-backed image widgets are still visible causes a segfault in _gdk_quartz_unref_cairo_surface during surface teardown. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 005e9bf in 9 seconds. Click for details.
- Reviewed
27lines of code in1files - Skipped
0files when reviewing. - Skipped posting
0draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
Workflow ID: wflow_Gcaj2UPBAYsCdE7N
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
Tests verify: - Borderless toggle: setting_borderless and set_decorated are called as separate operations with plain boolean arguments - before_dying cleanup: image widgets are hidden before any destroy calls, enforcing the order that prevents macOS Quartz segfaults Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
|
Both issues resolved in #2207 update |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix GTK3 bugs in map.lic: borderless toggle crash and macOS teardown segfault
Summary
set_decoratedcallBug 1: Borderless toggle crash
Line 697 — The
toggledsignal handler uses a compound expression:This passes the result of an inline assignment through negation into
set_decorated, which crashes gobject-introspection'sinvokeon some platforms. The Ruby expression is valid, but the GObject binding chokes on the intermediate value.Fix: Split into two statements:
Bug 2: macOS Quartz segfault on script kill
Lines 1126-1129 — The
before_dyingblock destroys the window without first detaching its Cairo-backed child widgets:On macOS with GTK3's Quartz backend, this can segfault in
_gdk_quartz_unref_cairo_surfaceduring surface teardown. The crash occurs because theGtk::Imagewidgets (image,circle_image) still hold references to Cairo surfaces when the parent window is destroyed.Fix: Hide the image widgets before destroying the window:
Test plan
;kill map) — no segfaultImportant
Fixes two segfault issues in
map.licrelated to GTK3: borderless toggle crash and macOS teardown segfault.map.licby splitting compound expression inmenu_borderless.signal_connect.before_dyingblock by hidingimageandcircle_imagebefore window destruction.This description was created by
for 005e9bf. You can customize this summary. It will automatically update as commits are pushed.