Fixed a crash
This commit is contained in:
parent
8436557418
commit
5433bc55f4
2
github
2
github
@ -1 +1 @@
|
|||||||
Subproject commit eb310aa0eafd254324a6f921f1c055c664bf48cc
|
Subproject commit cca898581e4b4138a2b4f99429d0bbd70a344bc4
|
@ -18,7 +18,11 @@ class ElectronContextMenu implements contextmenu.ContextMenuProvider {
|
|||||||
|
|
||||||
for(const listener of this._close_listeners) {
|
for(const listener of this._close_listeners) {
|
||||||
if(listener) {
|
if(listener) {
|
||||||
listener();
|
try {
|
||||||
|
listener();
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Failed to call context menu close listener: %o", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this._close_listeners = [];
|
this._close_listeners = [];
|
||||||
|
@ -89,14 +89,13 @@ void UDPSocket::finalize() {
|
|||||||
if(event_write) event_del_noblock(event_write);
|
if(event_write) event_del_noblock(event_write);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(io_base)
|
if(io_base) {
|
||||||
event_base_loopexit(io_base, nullptr);
|
event_base_loopexit(io_base, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
if(is_event_thread) {
|
if(is_event_thread) {
|
||||||
event_base_loopexit(io_base, nullptr);
|
|
||||||
this->_io_thread.detach();
|
this->_io_thread.detach();
|
||||||
} else {
|
} else {
|
||||||
event_base_loopexit(io_base, nullptr);
|
|
||||||
if(this->_io_thread.joinable())
|
if(this->_io_thread.joinable())
|
||||||
this->_io_thread.join();
|
this->_io_thread.join();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user