OSDN Git Service

SettingsDialog: Do the existing instance check in __new__ instead of __init__ so...
authorJames Teh <jamie@jantrid.net>
Tue, 15 Feb 2011 06:07:46 +0000 (16:07 +1000)
committerJames Teh <jamie@jantrid.net>
Tue, 15 Feb 2011 06:07:46 +0000 (16:07 +1000)
commit69b7af3265349efcf86de97aca3b26056ea45bac
treeaee56e50dd76aaba986552583bb13af04bd44f43
parent2d5b8f780408053a9500405ae4499de52e9a195e
SettingsDialog: Do the existing instance check in __new__ instead of __init__ so that the object isn't even constructed if there is already an instance.
Previously, __del__ was being called even if __init__ raised an exception, so _hasInstance was being cleared when it shouldn't.
Fixes the issue where you could open a second NVDA settings dialog if you tried twice.
source/gui/settingsDialogs.py