Skip to content
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1ccdf8b
push crash dump as appveyor artifact
seanbudd Mar 18, 2021
c605479
create safeAppExit
seanbudd Mar 18, 2021
d57d486
remove unnecessary Destroy call
seanbudd Mar 18, 2021
bf9447e
check if crashDump exists before pushing
seanbudd Mar 18, 2021
49eb9e7
revert d57d486941e63f04e9dd209ca3615325adb5dca0
seanbudd Mar 18, 2021
684b9de
improve handling of welcomedialog closing
seanbudd Mar 18, 2021
80e41ed
revert to previous behaviour to trigger appveyor crash dump
seanbudd Mar 18, 2021
0e628c4
Revert "revert to previous behaviour to trigger appveyor crash dump"
seanbudd Mar 18, 2021
cbf39f6
add appveyor fail when crash dump on install process
seanbudd Mar 18, 2021
a469c4d
revert to previous behaviour to trigger appveyor crash dump
seanbudd Mar 18, 2021
79aea67
Revert "revert to previous behaviour to trigger appveyor crash dump"
seanbudd Mar 18, 2021
eb89a33
add better comments
seanbudd Mar 22, 2021
a5dc8d3
rename installer crash file
seanbudd Mar 22, 2021
da7d307
improve commenting
seanbudd Mar 22, 2021
6d7da7f
trigger appveyor crash
seanbudd Mar 22, 2021
1abbbd9
Revert "trigger appveyor crash"
seanbudd Mar 22, 2021
552711f
simplify appveyor push
seanbudd Mar 22, 2021
aacf6e1
Merge branch 'master' into fix-12153
seanbudd Mar 23, 2021
05b8891
Merge remote-tracking branch 'origin/master' into fix-12153
seanbudd Mar 23, 2021
8f577c2
move mainFrame exiting service to mainFrame, better logging
seanbudd Mar 23, 2021
d7aea3b
destroy the mainFrame to exit the App
seanbudd Mar 23, 2021
439d7c0
fix lint
seanbudd Mar 23, 2021
5475681
Merge branch 'master' into fix-12153
seanbudd Mar 24, 2021
1fc0981
minimize diff
seanbudd Mar 24, 2021
c915591
handle all top level window desctruction from safe app exit
seanbudd Mar 24, 2021
9eb32c7
use close behaviour where possible
seanbudd Mar 24, 2021
f5eba29
improved logging
seanbudd Mar 25, 2021
7786252
update changes t2t
seanbudd Mar 25, 2021
1564328
Merge remote-tracking branch 'origin/master' into fix-12153
seanbudd Mar 25, 2021
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
6 changes: 6 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,12 @@ before_test:
Add-AppveyorMessage "Unable to install NVDA prior to tests."
}
Push-AppveyorArtifact $installerLogFilePath
$crashDump = "$outputDir\nvda_crash.dmp"
if (Test-Path -Path $crashDump){
Push-AppveyorArtifact $crashDump -FileName "nvda_install_crash.dmp"
Add-AppveyorMessage "Install process crashed"
$errorCode=1
}
if($errorCode -ne 0) { $host.SetShouldExit($errorCode) }

test_script:
Expand Down
4 changes: 2 additions & 2 deletions source/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ def onResult(ID):
def restart(disableAddons=False, debugLogging=False):
"""Restarts NVDA by starting a new copy."""
if globalVars.appArgs.launcher:
import wx
import gui
globalVars.exitCode=3
wx.GetApp().ExitMainLoop()
gui.safeAppExit()
return
import subprocess
import winUser
Expand Down
29 changes: 18 additions & 11 deletions source/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ def __init__(self):
self.Show()
self.Hide()

def Destroy(self):
self.sysTrayIcon.Destroy()
super(MainFrame, self).Destroy()

def prePopup(self):
"""Prepare for a popup.
This should be called before any dialog or menu which should pop up for the user.
Expand Down Expand Up @@ -199,7 +195,7 @@ def onExitCommand(self, evt):
d.Show()
self.postPopup()
else:
wx.GetApp().ExitMainLoop()
safeAppExit()

def onNVDASettingsCommand(self,evt):
self._popupSettingsDialog(NVDASettingsDialog)
Expand Down Expand Up @@ -359,6 +355,21 @@ def onConfigProfilesCommand(self, evt):
ProfilesDialog(gui.mainFrame).Show()
self.postPopup()


def safeAppExit():
"""
Ensures the app is exited by all the top windows being destroyed
"""
Comment thread
feerrenrut marked this conversation as resolved.
Resolved

for window in wx.GetTopLevelWindows():
if isinstance(window, wx.Dialog):
if window.IsModal():
wx.CallAfter(window.EndModal, wx.ID_CLOSE_ALL)
if not isinstance(window, MainFrame):
wx.CallAfter(window.Close)
else:
wx.CallAfter(window.Destroy)

Comment thread
feerrenrut marked this conversation as resolved.
Resolved
class SysTrayIcon(wx.adv.TaskBarIcon):

def __init__(self, frame):
Expand Down Expand Up @@ -527,10 +538,6 @@ def __init__(self, frame):
self.Bind(wx.adv.EVT_TASKBAR_LEFT_DOWN, self.onActivate)
self.Bind(wx.adv.EVT_TASKBAR_RIGHT_DOWN, self.onActivate)

def Destroy(self):
self.menu.Destroy()
super(SysTrayIcon, self).Destroy()

def onActivate(self, evt):
mainFrame.prePopup()
import appModules.nvda
Expand Down Expand Up @@ -585,7 +592,7 @@ def terminate():
# This is called after the main loop exits because WM_QUIT exits the main loop
# without destroying all objects correctly and we need to support WM_QUIT.
# Therefore, any request to exit should exit the main loop.
wx.CallAfter(mainFrame.Destroy)
safeAppExit()
# #4460: We need another iteration of the main loop
# so that everything (especially the TaskBarIcon) is cleaned up properly.
# ProcessPendingEvents doesn't seem to work, but MainLoop does.
Expand Down Expand Up @@ -712,7 +719,7 @@ def onOk(self, evt):
if action >= 2 and config.isAppX:
action += 1
if action == 0:
wx.GetApp().ExitMainLoop()
safeAppExit()
elif action == 1:
queueHandler.queueFunction(queueHandler.eventQueue,core.restart)
elif action == 2:
Expand Down
4 changes: 2 additions & 2 deletions source/gui/installerGui.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def doInstall(
winUser.SW_SHOWNORMAL
)
else:
wx.GetApp().ExitMainLoop()
gui.safeAppExit()


def doSilentInstall(
Expand Down Expand Up @@ -450,7 +450,7 @@ def doCreatePortable(portableDirectory,copyUserConfig=False,silent=False,startAf
return
d.done()
if silent:
wx.GetApp().ExitMainLoop()
gui.safeAppExit()
else:
# Translators: The message displayed when a portable copy of NVDA has been successfully created.
# %s will be replaced with the destination directory.
Expand Down
2 changes: 1 addition & 1 deletion source/gui/startupDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def onContinueRunning(self, evt):
core.doStartupDialogs()

def onExit(self, evt):
wx.GetApp().ExitMainLoop()
gui.safeAppExit()

@classmethod
def run(cls):
Expand Down