Merge lp:~niclasl/pantheon-terminal/fix-1327526 into lp:~elementary-apps/pantheon-terminal/trunk
Proposed by
Niclas Lockner
Status: | Merged |
---|---|
Approved by: | Raphael Isemann |
Approved revision: | 595 |
Merged at revision: | 592 |
Proposed branch: | lp:~niclasl/pantheon-terminal/fix-1327526 |
Merge into: | lp:~elementary-apps/pantheon-terminal/trunk |
Diff against target: |
59 lines (+12/-10) 2 files modified
src/PantheonTerminalWindow.vala (+7/-4) src/TerminalWidget.vala (+5/-6) |
To merge this branch: | bzr merge lp:~niclasl/pantheon-terminal/fix-1327526 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphael Isemann (community) | code and functionality | Approve | |
Sergey "Shnatsel" Davidoff (community) | Approve | ||
Review via email: mp+229307@code.launchpad.net |
Commit message
Fixed shutdown when the user cancels the dialog as described in #1327526
Description of the change
1. Wait with the shell termination until all dialog windows has been processed and it is known that the window will close
2. Retry to terminate the shell as long as it hasn't terminated (Fixes an issue where the shell didn't terminate when kill_fg_and_term_ps was called)
To post a comment you must log in.
Fixes said bug and the rest still works. Code-style is correct too.
The thing that bugs me is the loop at the end:
1.
Posix.usleep (100);
is also available in the GLib via
GLib.Thread.usleep (100);
2. I those lines should to be the other way round, as we first should send a signal and then wait.
Posix.usleep (100);
Posix.kill (this.child_pid, Posix.SIGTERM);
3. This
Posix.kill (this.child_pid, 0) != -1
can be
Posix.kill (this.child_pid, 0) == 0
on both occurrences.
Also a comment like
// Check if PID is valid
should be added as it's not that obvious what kill with sig 0 does.
4. I think we shouldn't SIGKILL here, but not sure what we should do instead. Let's add shnatsel and see what his opinion is on this topic.
Posix.kill (this.child_pid, Posix.SIGKILL);