Scratch loses data on catching SIGINT or SIGTERM

Bug #1115231 reported by Sergey "Shnatsel" Davidoff
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Scratch
Fix Released
Medium
Sergey "Shnatsel" Davidoff

Bug Description

Scratch loses unsaved data when it receives SIGINT or SIGTERM. It should call the regular quit method instead, as SIGINT and SIGTERM are equivalent to requesting the app to quit.

Tags: data-loss

Related branches

description: updated
tags: added: data-loss
Changed in scratch:
status: New → In Progress
assignee: nobody → Sergey "Shnatsel" Davidoff (shnatsel)
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

I've tried connecting action_quit () to those signals but I get the following error:

 error: Argument 2: Cannot convert from `Scratch.MainWindow.action_quit' to `GLib.SourceFunc'
            Unix.signal_add (Posix.SIGINT, action_quit, Priority.HIGH);
                                           ^^^^^^^^^^^

Trying to work that around gave me absolutely nonsential errors. I must be missing something.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

My code is available in the linked branch for anyone wishing to toy with it.

Changed in scratch:
assignee: Sergey "Shnatsel" Davidoff (shnatsel) → nobody
status: In Progress → New
Changed in scratch:
status: New → In Progress
assignee: nobody → Sergey "Shnatsel" Davidoff (shnatsel)
Changed in scratch:
milestone: none → 1.2
importance: Undecided → Medium
status: In Progress → Fix Committed
Cody Garver (codygarver)
Changed in scratch:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.