mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-03 23:20:25 +08:00
改进退出程序时关闭数据库写入
This commit is contained in:
@@ -24,6 +24,11 @@ func On(event Event, callback func()) {
|
||||
OnKey(event, nil, callback)
|
||||
}
|
||||
|
||||
func OnClose(callback func()) {
|
||||
On(EventQuit, callback)
|
||||
On(EventTerminated, callback)
|
||||
}
|
||||
|
||||
// OnKey 使用Key增加事件回调
|
||||
func OnKey(event Event, key interface{}, callback func()) {
|
||||
if key == nil {
|
||||
|
||||
Reference in New Issue
Block a user