mirror of
https://github.com/webui-dev/webui
synced 2025-03-28 21:13:17 +00:00
macOS WebView adding exit Timer
This commit is contained in:
parent
130a26cc21
commit
b1595c766c
@ -33,10 +33,20 @@ void (*close_callback)(int index) = NULL;
|
||||
windows[i] = nil;
|
||||
webViews[i] = nil;
|
||||
}
|
||||
|
||||
[NSTimer scheduledTimerWithTimeInterval:3.0
|
||||
target:self
|
||||
selector:@selector(_webui_macos_wv_timer)
|
||||
userInfo:nil
|
||||
repeats:YES];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)_webui_macos_wv_timer {
|
||||
_webui_macos_wv_check_exit();
|
||||
}
|
||||
|
||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
|
||||
#ifdef WEBUI_LOG
|
||||
printf("[ObjC]\t\t\tapplicationDidFinishLaunching()\n");
|
||||
@ -116,6 +126,12 @@ void (*close_callback)(int index) = NULL;
|
||||
|
||||
AppDelegate *delegate;
|
||||
|
||||
void _webui_macos_wv_check_exit() {
|
||||
if (_webui_mutex_app_is_exit_now()) {
|
||||
_webui_macos_wv_stop();
|
||||
}
|
||||
}
|
||||
|
||||
bool _webui_macos_wv_new(int index) {
|
||||
#ifdef WEBUI_LOG
|
||||
printf("[ObjC]\t\t\t_webui_macos_wv_new([%d])\n", index);
|
||||
|
Loading…
x
Reference in New Issue
Block a user