Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions PyMemoryEditor/app/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,9 @@ def main(argv=None):

from ._icon import app_icon

import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
Comment on lines +479 to +480

@JeanExtreme002 JeanExtreme002 Aug 3, 2026

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one change with a real consequence, plus the missing rationale.

signal.signal() returns the previous handler — capturing it lets the finally at line 505 restore it (see review body). Without that, any in-process caller of main() is left with SIG_DFL for good.

The suggestion drops the local import signal; please add it at the module top next to import sys instead.

Suggested change
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
# Qt's event loop blocks inside C++, so Python's default SIGINT handler only
# runs once the interpreter next regains control. In practice it raised
# KeyboardInterrupt inside our own eventFilter override (line 189), where
# PySide6 swallows it and merely prints a traceback (#76). Hand SIGINT back
# to the OS so Ctrl+C from a terminal terminates the app immediately, and
# keep the previous handler so in-process callers are not left with SIG_DFL.
previous_sigint = signal.signal(signal.SIGINT, signal.SIG_DFL)


app = QApplication.instance() or QApplication(argv)
app.setApplicationName("PyMemoryEditor")
app.setApplicationDisplayName("PyMemoryEditor App")
Expand Down
Loading