This commit is contained in:
恍兮惚兮 2024-05-29 12:42:12 +08:00
parent 07d1172614
commit ef52227523
2 changed files with 10 additions and 9 deletions

View File

@ -122,12 +122,9 @@ class edittrans(QMainWindow):
self.trykeeppos() self.trykeeppos()
def trykeeppos(self): def trykeeppos(self):
try: self.followhwnd = gobject.baseobject.textsource.hwnd
self.followhwnd = gobject.baseobject.textsource.hwnd self.follow()
self.follow() self.show()
self.show()
except:
pass
@threader @threader
def follow(self): def follow(self):

View File

@ -43,8 +43,12 @@ def Singleton_impl(cls, behavior="activate"):
self.deleteLater() self.deleteLater()
_instance.pop(cls) _instance.pop(cls)
_lock.release() _lock.release()
try:
_inst = __(*args, **kwagrs) _inst = __(*args, **kwagrs)
except:
print_exc()
_lock.release()
return None
if _inst.Singleton_flag: if _inst.Singleton_flag:
_instance[cls] = _inst _instance[cls] = _inst
return _inst return _inst